Skip to content

Commit

Permalink
feat(examples): unbond and transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 19, 2024
1 parent 6ee57ba commit 2163957
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/orchestration/src/examples/unbond.flows.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ export const unbondAndTransfer = async (orch, { zcf }) => {
const stride = await orch.getChain('stride');
const strideAccount = await stride.makeAccount();

// TODO the `TIA` string actually needs to be the Brand from AgoricNames
// const tiaAmt = await celestiaAccount.getBalance('TIA');
// await celestiaAccount.transfer(tiaAmt, strideAccount.getAddress());
// TODO https://github.com/Agoric/agoric-sdk/issues/10017
// await strideAccount.liquidStake(tiaAmt);
console.log(osmoAccount, strideAccount);
const balance = await osmoAccount.getBalance('OSMO');
await osmoAccount.transfer(balance, strideAccount.getAddress());
};
harden(unbondAndTransfer);
8 changes: 8 additions & 0 deletions packages/orchestration/test/examples/unbond.contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import path from 'path';
import { inspectMapStore } from '@agoric/internal/src/testing-utils.js';
import { QueryDelegatorDelegationsResponse } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/query.js';
import { MsgUndelegateResponse } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
import { MsgTransferResponse } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
import { QueryBalanceResponse } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/query.js';
import { commonSetup } from '../supports.js';
import {
buildMsgResponseString,
Expand Down Expand Up @@ -50,6 +52,12 @@ test('start', async t => {
makeDelegationsResponse(),
'eyJ0eXBlIjoxLCJkYXRhIjoiQ2xzS0pTOWpiM050YjNNdWMzUmhhMmx1Wnk1Mk1XSmxkR0V4TGsxeloxVnVaR1ZzWldkaGRHVVNNZ29MWTI5emJXOXpNWFJsYzNRU0VXTnZjMjF2YzNaaGJHOXdaWEl4ZUhsNkdoQUtCWFZ2YzIxdkVnY3hNREF3TURBdyIsIm1lbW8iOiIifQ==':
makeUndelegateResponse(),
'eyJkYXRhIjoiQ2prS0V3b0xZMjl6Ylc5ek1YUmxjM1FTQkU5VFRVOFNJaTlqYjNOdGIzTXVZbUZ1YXk1Mk1XSmxkR0V4TGxGMVpYSjVMMEpoYkdGdVkyVT0iLCJtZW1vIjoiIn0=':
buildQueryResponseString(QueryBalanceResponse, {
balance: { denom: 'uosmo', amount: '1234' },
}),
'eyJ0eXBlIjoxLCJkYXRhIjoiQ25rS0tTOXBZbU11WVhCd2JHbGpZWFJwYjI1ekxuUnlZVzV6Wm1WeUxuWXhMazF6WjFSeVlXNXpabVZ5RWt3S0NIUnlZVzV6Wm1WeUVndGphR0Z1Ym1Wc0xUTXlOaG9OQ2dWMWIzTnRieElFTVRJek5DSUxZMjl6Ylc5ek1YUmxjM1FxREdOdmMyMXZjekYwWlhOME1USUFPSUR3MXRUQ3pySUciLCJtZW1vIjoiIn0=':
buildMsgResponseString(MsgTransferResponse, {}),
};
};

Expand Down

0 comments on commit 2163957

Please sign in to comment.