-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RESTful governance endpoints #1357
Conversation
Something weird happening in the CI. Says authentication required to pull from the docker repo |
@rigelrozanski How do I get it to rerun the circle tests? |
If you force push to your current branch, that may refresh it. Otherwhise, merge in develop, or rerun the tests manually. (Click on details for each test, then rerun via ssh in the top right) |
x/gov/client/rest/rest.go
Outdated
bechVoterAddr := vars[RestVoter] | ||
|
||
if len(strProposalID) == 0 { | ||
w.WriteHeader(http.StatusBadRequest) | ||
// w.WriteHeader(http.StatusBadRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need these headers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oops, commented these out for some debugging thing. Will uncomment them
// REST | ||
|
||
// Rest Deposits | ||
type DepositRest struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's come up with a naming schema for REST output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pulling in @cwgoes @rigelrozanski
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DepositRest
is fine IMO
Looks pretty nice :) |
@ValarDragon Did you figure out the CI problem? |
Codecov Report
@@ Coverage Diff @@
## develop #1357 +/- ##
===========================================
- Coverage 63.78% 63.72% -0.07%
===========================================
Files 109 109
Lines 6028 6034 +6
===========================================
Hits 3845 3845
- Misses 1964 1970 +6
Partials 219 219 |
x/gov/depositsvotes.go
Outdated
|
||
// Turn any Deposit to a DepositRest | ||
func DepositToRest(deposit Deposit) DepositRest { | ||
bechAddr, _ := sdk.Bech32ifyAcc(deposit.Depositer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdk.MustBech32ifyAcc
@@ -264,7 +264,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID int64, depositerAddr | |||
// Add or update deposit object | |||
currDeposit, found := keeper.GetDeposit(ctx, proposalID, depositerAddr) | |||
if !found { | |||
newDeposit := Deposit{depositerAddr, depositAmount} | |||
newDeposit := Deposit{depositerAddr, proposalID, depositAmount} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to store a copy of the proposal ID in each deposit? Can't we retrieve it from the key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Technically we don't even need to to store the depositerAddr either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - #1419.
…into sunny/governance_rest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK
* get deposit rest endpoint * query proposals * changelog * fixed commented out headers * fixed undeterministic tests * increase circle test timeout * MustBech32ifyAcc * asdf
closes #1284