Skip to content
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

R4R: Implement fee distribution RESTful endpoints #3460

Merged
merged 29 commits into from
Feb 5, 2019
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift click to select a range
d14e919
Factor params query logic out
Jan 30, 2019
9dc2199
REST skeleton
Jan 30, 2019
14f1b07
Start working on params query
Jan 30, 2019
27a8f2c
Implement pool endpoint and querier
Jan 31, 2019
4eac5e8
Implement GET /distribution/delegators/{delegatorAddr}/rewards
Jan 31, 2019
d5939a1
Add delegation query
Jan 31, 2019
50bf781
Refactor, make new client common sub-package
Jan 31, 2019
71d2898
Implement GET /distribution/delegators/{delegatorAddr}/withdraw_address
Jan 31, 2019
effc2e9
WIP, issue is blocked
Feb 1, 2019
094aa52
Update distribution swagger.yaml section for F1
cwgoes Feb 1, 2019
009e927
Replace pool with outstanding_rewards
Feb 1, 2019
fd26e55
Finalize query endpoints
Feb 1, 2019
be16e5c
Implement POST /delegators/{delegatorAddr}/rewards/{validatorAddr}
Feb 4, 2019
9e9e665
Implement /validators/{validatorAddr}/rewards
Feb 1, 2019
32811f9
Factour out logic to prepare multi-msg withdrawal
Feb 1, 2019
1d5cf3f
WIP
Feb 2, 2019
f12c772
all_delegation_rewards -> total_delegation_rewards
Feb 4, 2019
834dd56
rigel/distr-queriers
Feb 4, 2019
bbc8f99
Implement /delegators/{delegatorAddr}/rewards
Feb 2, 2019
bb8767d
Implement cli withdraw-all-rewards command as multi-message tx
Feb 2, 2019
ec34237
Implement /delegators/{delegatorAddr}/withdraw_address
Feb 2, 2019
20826e8
invert abort with ok
Feb 2, 2019
4e23cf3
Clean up
Feb 2, 2019
a285f10
Update PENDING.md
Feb 4, 2019
0e9504c
Clean up rebase leftover, port to new rest package
Feb 4, 2019
d18d7eb
Don't write errors twice when ReadRESTReq() fails
Feb 4, 2019
4291cbe
Update PENDING.md
Feb 4, 2019
045d9f4
Split up QueryRewards
Feb 4, 2019
09239a9
Add tests
Feb 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP, issue is blocked
  • Loading branch information
Alessio Treglia committed Feb 4, 2019
commit effc2e9b09f5bb48a4ca15fef65fe769cbd97035
26 changes: 26 additions & 0 deletions x/distribution/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 35,18 @@ func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router,
delegatorWithdrawalAddrHandlerFn(cliCtx, cdc, queryRoute),
).Methods("GET")

// Validator distribution information
r.HandleFunc(
"/distribution/validator/{validatorAddr}",
validatorInfoHandlerFn(cliCtx, cdc, queryRoute),
).Methods("GET")

// Commission and self-delegation rewards of a single a validator
r.HandleFunc(
"/distribution/validator/{validatorAddr}/rewards",
validatorRewardsHandlerFn(cliCtx, cdc, queryRoute),
).Methods("GET")

// Get the current distribution parameter values
r.HandleFunc(
"/distribution/parameters",
Expand Down Expand Up @@ -109,6 121,20 @@ func delegatorWithdrawalAddrHandlerFn(cliCtx context.CLIContext, cdc *codec.Code
}
}

// HTTP request handler to query validator's distribution information
func validatorInfoHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec,
queryRoute string) http.HandlerFunc {

return func(w http.ResponseWriter, r *http.Request) {}
}

// HTTP request handler to query validator's commission and self-delegation rewards
func validatorRewardsHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec,
queryRoute string) http.HandlerFunc {

return func(w http.ResponseWriter, r *http.Request) {}
}

// HTTP request handler to query the distribution params values
func paramsHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec,
queryRoute string) http.HandlerFunc {
Expand Down