-
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
rosetta delegator address balances #8421
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
defnotzed
force-pushed
the
zed/balance
branch
2 times, most recently
from
May 30, 2023 16:58
1d0927b
to
a0e867f
Compare
xindingw
reviewed
May 30, 2023
defnotzed
force-pushed
the
zed/balance
branch
2 times, most recently
from
May 31, 2023 22:54
4a5fc24
to
8958349
Compare
xindingw
reviewed
May 31, 2023
xiaoxiaff
approved these changes
Jun 2, 2023
xiaoxiaff
approved these changes
Jun 2, 2023
xiaoxiaff
approved these changes
Jun 2, 2023
nicolas-martin
approved these changes
Jun 2, 2023
xindingw
reviewed
Jun 2, 2023
requested_balance = balances_result.get(1).and_then(|v| v.as_str().map(|s| s.to_owned())); | ||
} else if account_identifier.is_delegator_pending_inactive_stake() { | ||
requested_balance = balances_result.get(2).and_then(|v| v.as_str().map(|s| s.to_owned())); | ||
} |
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.
nit: Maybe throw "Unable to construct BalanceResult instance" error here?
xindingw
approved these changes
Jun 2, 2023
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.
LGTM! Let me know if you need me to find another approver.
davidiw
approved these changes
Jun 2, 2023
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
gedigi
pushed a commit
that referenced
this pull request
Jun 6, 2023
* rosetta delegator address balances * address comments * e2e test fix * cargo xclippy * run rust lint script --------- Co-authored-by: Zizheng Jiang <zizheng.jiang@coinbase.com>
banool
pushed a commit
that referenced
this pull request
Jul 7, 2023
* rosetta delegator address balances * address comments * e2e test fix * cargo xclippy * run rust lint script --------- Co-authored-by: Zizheng Jiang <zizheng.jiang@coinbase.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Implement the delegator address balances rosetta endpoint.
The rosetta client should manage its own delegator and pool address relationship when fetching relevant data.
The request payload should look like this (added the metadata field under sub_account_identifier):
About balance fetching:
Using delegator address 0x65b1e4d62e803d7e3a5c715baa33391757ae530c9fef287bf2d7d15c1ea6e3e6 and its validator address 0x2ded75e99c6efbe143a9648a3e88ebf9d0cf249b2af44d510bdd0287e8adcc79 as an example
The response should be similar to native staking:
Variables that should be fetched from the delegator address:
0x1::account::Account
resourceVariables should be fetched from the pool address:
1. Operator from0x1::stake::StakePool
resource2. Lockup until secs from
0x1::stake::StakePool
resourceTest Plan
Tested with remote online node from e2e
delegated staking balance
native staking balance
direct balance