Skip to content

Commit

Permalink
fixup! feat: WithdrawReward on StakingAccountHolder
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed May 2, 2024
1 parent d3807fc commit d47a07e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/orchestration/src/exos/stakingAccountKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const prepareStakingAccountKit = (baggage, makeRecorderKit, zcf) => {
*/
async withdrawReward(validatorAddress) {
const { chainAddress } = this.state;
assert.typeof(validatorAddress, 'string');
const msg = MsgWithdrawDelegatorReward.toProtoMsg({
delegatorAddress: chainAddress,
validatorAddress,
Expand Down
5 changes: 3 additions & 2 deletions packages/orchestration/test/test-withdraw-reward.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const makeScenario = () => {
const calls = [];

const simulate = {
'/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward': _m => {
'/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward': m => {
console.log('simulate withdraw', m);
const rewards = Object.values(delegations).map(({ denom, amount }) => ({
denom,
amount: `${Number(amount) / 100}`,
Expand Down Expand Up @@ -149,7 +150,7 @@ test('withdraw rewards from staking account holder', async t => {
// Higher fidelity tests below use invitationMakers.
const { helper } = make(account, storageNode, account.getAccountAddress());
const { validator } = scenario1;
const actual = await E(helper).withdrawReward(validator);
const actual = await E(helper).withdrawReward(validator.address);
t.deepEqual(actual, [{ denom: 'uatom', value: 2n }]);
});

Expand Down

0 comments on commit d47a07e

Please sign in to comment.