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

go/staking/api: Add new delegation querying methods #3774

Merged
merged 9 commits into from
Mar 15, 2021

Conversation

tjanez
Copy link
Member

@tjanez tjanez commented Mar 11, 2021

Additionally, refactor go/staking/tests:

  • Move go/staking/tests/debug into go/staking/tests package.
  • Generalize account handling and add delegations.

Extracted from #3725.

@tjanez tjanez added c:testing Category: testing c:staking Category: staking labels Mar 11, 2021
@tjanez tjanez force-pushed the tjanez/delegation-query-methods branch from 4883259 to 4df8be3 Compare March 11, 2021 16:56
Copy link
Member

@kostko kostko left a 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!

go/staking/tests/accounts.go Outdated Show resolved Hide resolved
go/staking/tests/state.go Outdated Show resolved Hide resolved
go/staking/tests/state.go Outdated Show resolved Hide resolved
go/staking/tests/state.go Outdated Show resolved Hide resolved
@tjanez tjanez force-pushed the tjanez/delegation-query-methods branch from 4df8be3 to 0a23c3e Compare March 12, 2021 11:50
@tjanez tjanez marked this pull request as ready for review March 12, 2021 11:53
@tjanez tjanez added the c:breaking/consensus Category: breaking consensus changes label Mar 15, 2021
tjanez added 3 commits March 15, 2021 10:55
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 tjanez force-pushed the tjanez/delegation-query-methods branch from 0a23c3e to d901961 Compare March 15, 2021 09:56
tjanez added 5 commits March 15, 2021 11:08
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 tjanez force-pushed the tjanez/delegation-query-methods branch from d901961 to 960a628 Compare March 15, 2021 10:08
@tjanez tjanez enabled auto-merge March 15, 2021 10:27
@tjanez tjanez merged commit ab027ce into master Mar 15, 2021
@tjanez tjanez deleted the tjanez/delegation-query-methods branch March 15, 2021 10:47
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants