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

Fedekunze/1010 lcd stake #1068

Merged
merged 32 commits into from
Aug 10, 2018
Merged
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fc2e561
updated endpoints with newest refactor
Aug 2, 2018
ee7ca94
Merge branch 'develop' of https://github.com/cosmos/voyager into fede…
Aug 2, 2018
bbffa6d
minor fixes
Aug 2, 2018
db90be8
switched to branch for testing staking
Aug 2, 2018
4c2da75
typo
Aug 2, 2018
b21b00b
adjusting to new API
Aug 2, 2018
61ba76e
made delegation kind of work
Aug 2, 2018
daef71f
showing old unbonding in pagebond
Aug 3, 2018
4ed2522
compatible to lcd staking refactor
Aug 3, 2018
a367f2b
Merge remote-tracking branch 'origin/develop' into fedekunze/1010-lcd…
Aug 6, 2018
dd65b7c
txs and other stuff working
Aug 6, 2018
18fa260
fixed some tests
Aug 7, 2018
6fbd396
linted
Aug 7, 2018
60d3bcc
fixed lcd mock tests
Aug 7, 2018
82e2d99
fixed lcdclient test
Aug 7, 2018
d2ac597
fixed pagetranscation test
Aug 7, 2018
e75045e
fixed app header tests (sideeffect)
Aug 7, 2018
22c49b4
Merge branch 'develop' into fedekunze/1010-lcd-stake
fedekunze Aug 8, 2018
6cc9ec2
Merge remote-tracking branch 'origin/develop' into fedekunze/1010-lcd…
Aug 8, 2018
ed7042b
fixed wrong indexing command
Aug 9, 2018
c01a5a8
added lcdclient mock tests
Aug 9, 2018
105a4b9
added merged commit
Aug 9, 2018
4033833
Merge branch 'fedekunze/1010-lcd-stake' of https://github.com/cosmos/…
Aug 9, 2018
28c660d
fix e2e tests
Aug 9, 2018
3bbe5da
using the commit of the delegation endpoint fix
Aug 9, 2018
2e8a7c0
Merge branch 'develop' into fedekunze/1010-lcd-stake
faboweb Aug 9, 2018
e58935b
increased coverage
Aug 9, 2018
9737d72
Merge branch 'fedekunze/1010-lcd-stake' of https://github.com/cosmos/…
Aug 9, 2018
b3119ad
removed notes
faboweb Aug 9, 2018
f9c20b8
increased coverage
Aug 9, 2018
0f2c28d
Merge branch 'fedekunze/1010-lcd-stake' of https://github.com/cosmos/…
Aug 9, 2018
f272b6b
Merge branch 'develop' into fedekunze/1010-lcd-stake
fedekunze Aug 10, 2018
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
56 changes: 52 additions & 4 deletions app/src/renderer/connectors/lcdClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,60 @@ Object.assign(Client.prototype, {
},
tx: argReq("GET", "/txs"),

// staking
updateDelegations: req("POST", "/stake/delegations"),
/* ============ STAKE ============ */

// Get all delegations information from a delegator
getDelegator: function(addr) {
return req("GET", `/stake/delegators/${addr}`).call(this)
},
// Get all txs from a delegator
getDelegatorTxs: function(addr) {
return req("GET", `/stake/delegators/${addr}/txs`).call(this)
},
// Get a specific tx from a delegator
getDelegatorTx: function(addr, id, types) {
if types === "" {
return req("GET", `/stake/delegators/${addr}/txs`).call(this)
} else {
return req("GET", `/stake/delegators/${addr}/txs?type=${types}`).call(this)
}
},
// // Query all validators that a delegator is bonded to
// getDelegatorValidators: function(delegatorAddr) {
// return req("GET", `/stake/delegators/${delegatorAddr}/validators`).call(this)
// },
// // Query a validator info that a delegator is bonded to
// getDelegatorValidator: function(delegatorAddr, validatorAddr) {
// return req("GET", `/stake/delegators/${delegatorAddr}/validators/${validatorAddr}`).call(this)
// },

// Get a list containing all the validator candidates
getValidators: req("GET", "/stakes/validators/"),
Copy link
Collaborator

@faboweb faboweb Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "stakes" instead of "stake"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason my ESlint wasn't working. I had to delete it and reinstall

// Get information from a validator
getValidator: function(addr) {
return req("GET", `/stake/validators/${addr}`).call(this)
},
// // Get all of the validator bonded delegators
// getValidatorDelegators: function(addr) {
// return req("GET", `/stake/validator/${addr}/delegators`).call(this)
// },

// Get the list of the validators in the latest validator set
getValidatorSet: req("GET", "/validatorsets/latest"),


updateDelegations: function(delegatorAddr) {
return req("POST", `/stake/delegators/${delegatorAddr}/delegations`)
}

candidates: req("GET", "/stake/validators"),
getValidators: req("GET", "/validatorsets/latest"),
queryDelegation: function(delegator, validator) {
return req("GET", `/stake/${delegator}/delegation/${validator}`).call(this)
// Query a delegation between a delegator and a validator
queryDelegation: function(delegatorAddr, validatorAddr) {
return req("GET", `/stake/delegators/${delegatorAddr}/delegations/${validatorAddr}`).call(this)
}
queryUnbonding: function(delegatorAddr, validatorAddr) {
return req("GET", `/stake/delegators/${delegatorAddr}/unbonding_delegations/${validatorAddr}`).call(this)
}
})

Expand Down