-
Notifications
You must be signed in to change notification settings - Fork 214
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
Scan stake pool registrations during wallet restoration. #1050
Scan stake pool registrations during wallet restoration. #1050
Conversation
75111f5
to
0a6850d
Compare
6d26526
to
0e6b3cd
Compare
0a6850d
to
51bb22f
Compare
@jonathanknowles why is this one still a draft + WIP ? Is it actually ready for review, what are the next steps? |
0e6b3cd
to
7a06c5e
Compare
Because I had put this on hold (temporarily) to work on other things. (Namely: PR #1057).
Understood. I'll update this shortly.
Not yet.
Three things:
|
51bb22f
to
84bf451
Compare
2220460
to
3f7de4c
Compare
3f7de4c
to
66a085d
Compare
94e7d01
to
75e139a
Compare
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
isOurs (ChimericAccount account) state = | ||
(account == ourAccount, state) | ||
where | ||
ourAccount = xpubPublicKey $ getRawKey $ rewardAccountKey state |
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.
👌
Fix comment for function `putDelegationCertificate`. Fix comment for function `applyBlock`. Fix comment for function `prefilterBlock`.
Use this type to replace the list of transactions returned by `applyBlock` and `applyBlocks`. Future changes will add more fields to this type.
This represents the set of stake delegations made on behalf of the wallet, listed in order of discovery.
For the moment, we return an empty list for the list of delegations.
When restoring blocks. Additionally, write a log entry for each certificate discovered.
a676584
to
2c31cbd
Compare
I've noted a quite important change to do when storing the delegation after discovery, but I'll make it another PR to keep this one concise. It doesn't affect the core functionality, but is important in terms of reliability and data consistency. |
bors r+ |
1050: Scan stake pool registrations during wallet restoration. r=KtorZ a=jonathanknowles # Issue Number #899 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> I have: - [x] Provided an implementation of `IsOurs (SeqState n k) ChimericAccount`. - [x] Adjusted the return type of `applyBlock` so that it references any stake delegation that has occurred on behalf of the specified wallet. - [x] Adjusted the definition of `restoreBlocks` so that it correctly processes the registrations returned by `applyBlocks`. - [x] Adjusted the definition of `applyBlock` to identify delegations relevant to the specified wallet, and return the final registration as part of `FilteredBlock`. - [x] Added tests to ensure that `applyBlock` does successfully discover delegations made by the wallet under test, and only that wallet. - [x] Added tests to ensure that a wallet's delegation status is correctly updated in the context of discovered delegations. <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
Build failed |
bors r+ |
1050: Scan stake pool registrations during wallet restoration. r=KtorZ a=jonathanknowles # Issue Number #899 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> I have: - [x] Provided an implementation of `IsOurs (SeqState n k) ChimericAccount`. - [x] Adjusted the return type of `applyBlock` so that it references any stake delegation that has occurred on behalf of the specified wallet. - [x] Adjusted the definition of `restoreBlocks` so that it correctly processes the registrations returned by `applyBlocks`. - [x] Adjusted the definition of `applyBlock` to identify delegations relevant to the specified wallet, and return the final registration as part of `FilteredBlock`. - [x] Added tests to ensure that `applyBlock` does successfully discover delegations made by the wallet under test, and only that wallet. - [x] Added tests to ensure that a wallet's delegation status is correctly updated in the context of discovered delegations. <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
Build succeeded |
1080: Implement quit stake pool r=paweljakubas a=paweljakubas # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #1074 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have handled NotDelegating case - [x] I have handled NoSuchPool case - [x] I have renamed mkDelegationCertTx to mkDelegationJoinTx and added new mkDelegationQuitTx - [x] I have added corresponding golden tests (if possible) - [x] I have reused create/sign functions in quitStakePool func - [x] I have adjusted integration tests (after #1050 is merged) # Comments <!-- Additional comments or screenshots to attach if any --> I do not think it is easy to add corresponding golden tests here <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Pawel Jakubas <[email protected]>
Issue Number
#899
Overview
I have:
IsOurs (SeqState n k) ChimericAccount
.applyBlock
so that it references any stake delegation that has occurred on behalf of the specified wallet.restoreBlocks
so that it correctly processes the registrations returned byapplyBlocks
.applyBlock
to identify delegations relevant to the specified wallet, and return the final registration as part ofFilteredBlock
.applyBlock
does successfully discover delegations made by the wallet under test, and only that wallet.