-
Notifications
You must be signed in to change notification settings - Fork 671
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
wallet: obtain subnet owners by using P-Chain's getSubnet API call #3247
Conversation
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.
Maybe add test coverage (unit or e2e) for the new functionality to minimize the potential for changes to avalanchego to unintentionally break CLI?
18e05e6
to
86a679e
Compare
Best option seems to be to add an e2e for TransferSubnetOwnershipTx but that seems outside the scope of this PR. |
Given that there is otherwise no coverage of the changes to wallet.go (unlike the unit-tested builder), I think it would be appropriate to include an e2e test in this PR. I'd be open to having the changes to the wallet extracted and trivially e2e-tested (i.e. create subnet, verify that new function returns the expected owners) if validation of usage in transaction handling seems unreasonable. |
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
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.
Please ensure e2e test coverage of the wallet change pre-merge.
refactored into separate function + added e2e @marun @StephenButtolph |
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.
Apologies for the delay!
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 cleanup!
Why this should be merged
currently the wallet is expected to receive as params the latest transform subnet ownership tx or tx id for the subnet,
so as to be able to obtain the current owner.
this is not needed as current owner can be obtained by calling P-Chain's getSubnet API call
How this works
it makes wallet's P-Chain backed to receive a map of subnet ids to owners.
on MakeWallet, the map is generated from the txs and tx ids in wallet config
How this was tested
it was tested using CLI command for changing subnet owners