-
Notifications
You must be signed in to change notification settings - Fork 115
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
go/staking/api: Add new delegation querying methods #3774
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tjanez
force-pushed
the
tjanez/delegation-query-methods
branch
from
March 11, 2021 16:56
4883259
to
4df8be3
Compare
kostko
reviewed
Mar 12, 2021
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.
Nice, some minor nits otherwise looks good!
tjanez
force-pushed
the
tjanez/delegation-query-methods
branch
from
March 12, 2021 11:50
4df8be3
to
0a23c3e
Compare
tjanez
requested review from
peterjgilbert,
pro-wh,
ptrus and
Yawning
as code owners
March 12, 2021 11:53
kostko
approved these changes
Mar 15, 2021
Add AccountList type to simplify creation and referencing of different staking accounts by their address or accessing their corresponding signer. Augment GenesisState() with more staking accounts and more active and debonding delegations from/to these accounts. Add accountData and accountDataList types and generalize handling of accounts in StakingImplementationTests. Use common testTransferHelper() for both testTransfer() and testSelfTransfer() tests.
Add new methods to ImmutableState type for querying incoming (debonding) delegations to an escrow account: - DelegationsTo() and - DebondingDelegationsTo().
Make it consistent with how (ordinary) delegation methods are ordered.
tjanez
force-pushed
the
tjanez/delegation-query-methods
branch
from
March 15, 2021 09:56
0a23c3e
to
d901961
Compare
They can be used to obtain all incoming (debonding) delegations to the given account.
This makes it consistent and less confusing in combination with the newly added DelegationsTo() method.
Rename it to DebondingDelegationsFor() to make it consistent and less confusing in combination with the newly added DebondingDelegationsTo() method.
They are (debonding) delegation descriptors with additional information about the share pool they belong to.
They can be used to obtain incoming (debonding) delegations with additional information for the given account.
tjanez
force-pushed
the
tjanez/delegation-query-methods
branch
from
March 15, 2021 10:08
d901961
to
960a628
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c:breaking/consensus
Category: breaking consensus changes
c:staking
Category: staking
c:testing
Category: testing
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additionally, refactor
go/staking/tests
:go/staking/tests/debug
intogo/staking/tests
package.Extracted from #3725.