-
Notifications
You must be signed in to change notification settings - Fork 24
feat(ProxyType): add support for claiming rewards #2628
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
feat(ProxyType): add support for claiming rewards #2628
Conversation
Added the ability to submit a Proxy.proxy extrinsic that calls RuntimeCall::Capacity(pallet_capacity::Call::claim_staking_reward). Previously, only pallet_capacity::Call::stake could be called using the ProxyType::Staking. Currently only staking
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
saraswatpuneet
left a comment
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
aramikm
left a comment
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.
Looks good! Do we need to test with a multisig account also since that was also one of the things they were doing.
|
@aramikm the multisig account is used to build the proxy address, which performs another proxy call. At the end it just comes in as a proxy call, so it should be fine. |
|
@aramikm your question made me feel paranoid so I wrote a multisig proxy test :) |
| }); | ||
|
|
||
| it('can boost, claim, and unstake via proxy account', async function () { | ||
| const boostAmount = 2n * DOLLARS; |
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.
this test was not passing for the reasons I thought. It is now fixed and I added some checks.
| ); | ||
|
|
||
| // assert that bob got the claimed rewards. | ||
| const bobNewBalance = await getFreeBalance(bob); |
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.
the proxy should not get the claimed rewards; bob, the "real" i.e. staker, should.
|
|
||
| it('multisig call as a proxy works for capacity staking ops', async function () { | ||
| // Input the addresses that will make up the multisig account. | ||
| const alice = await createAndFundKeypair(fundingSource, 2000n * DOLLARS, 'alice'); |
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.
this could be cleaned up a little, but I wanted to ensure that it worked
| ); | ||
|
|
||
| // Helpers | ||
| // the weight for this is pretty high |
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.
I pulled the weights from the Frequency txn that failed and bumped them up a bit
shannonwells
left a comment
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.
Approving since the tests I wrote validate @enddynayn 's fix.
JoeCap08055
left a comment
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.
Love the additional tests!
👍🏻
enddynayn
left a comment
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.
👍 superb!
Purpose
We have account holders that need to be able to use proxies for Capacity staking.
Previously, only pallet_capacity::Call::stake could be called using the ProxyType::Staking.
Change summary
RuntimeCall::Capacity(pallet_capacity::Call::claim_staking_reward).