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 3653fcd commit d3807fc
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/orchestration/src/exos/stakingAccountKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ export const prepareStakingAccountKit = (baggage, makeRecorderKit, zcf) => {
},

/**
* @param {CosmosValidatorAddress} validator
* @param {string} validatorAddress
* @returns {Promise<ChainAmount[]>}
*/
async withdrawReward(validator) {
async withdrawReward(validatorAddress) {
const { chainAddress } = this.state;
const msg = MsgWithdrawDelegatorReward.toProtoMsg({
delegatorAddress: chainAddress,
validatorAddress: validator.address,
validatorAddress,
});
const account = this.facets.helper.owned();
const result = await E(account).executeEncodedTx([toAnyJSON(msg)]);
Expand Down Expand Up @@ -236,13 +236,9 @@ export const prepareStakingAccountKit = (baggage, makeRecorderKit, zcf) => {
makeWithdrawRewardInvitation(validatorAddress) {
trace('makeWithdrawRewardInvitation', validatorAddress);

const validator = {
address: validatorAddress,
addressEncoding: 'bech32',
};
return zcf.makeInvitation(async seat => {
seat.exit();
return this.facets.helper.withdrawReward(validator);
return this.facets.helper.withdrawReward(validatorAddress);
}, 'WithdrawReward');
},
makeCloseAccountInvitation() {
Expand Down

0 comments on commit d3807fc

Please sign in to comment.