diff --git a/packages/boot/test/bootstrapTests/orchestration.test.ts b/packages/boot/test/bootstrapTests/orchestration.test.ts index 5be8257f3ef9..cea3574fe422 100644 --- a/packages/boot/test/bootstrapTests/orchestration.test.ts +++ b/packages/boot/test/bootstrapTests/orchestration.test.ts @@ -174,7 +174,12 @@ test.serial('stakeAtom - smart wallet', async t => { t.like(wd.getLatestUpdateRecord(), { status: { id: 'request-account', numWantsSatisfied: 1 }, }); - t.is(readLatest('published.stakeAtom.accounts.cosmos1test'), ''); + t.deepEqual(readLatest('published.stakeAtom.accounts.cosmos1test'), { + localAddress: + '/ibc-port/icacontroller-1/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-1', + remoteAddress: + '/ibc-hop/connection-8/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-1', + }); const { ATOM } = agoricNamesRemotes.brand; ATOM || Fail`ATOM missing from agoricNames`; @@ -321,7 +326,12 @@ test('basic-flows', async t => { t.like(wd.getLatestUpdateRecord(), { status: { id: 'request-coa', numWantsSatisfied: 1 }, }); - t.is(readLatest('published.basicFlows.cosmos1test'), ''); + t.deepEqual(readLatest('published.basicFlows.cosmos1test'), { + localAddress: + '/ibc-port/icacontroller-4/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-4', + remoteAddress: + '/ibc-hop/connection-8/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-4', + }); // create a local orchestration account await wd.executeOffer({ @@ -506,7 +516,12 @@ test.serial('basic-flows - portfolio holder', async t => { status: { id: 'request-portfolio-acct', numWantsSatisfied: 1 }, }); // XXX this overrides a previous account, since mocks only provide one address - t.is(readLatest('published.basicFlows.cosmos1test'), ''); + t.deepEqual(readLatest('published.basicFlows.cosmos1test'), { + localAddress: + '/ibc-port/icacontroller-3/ordered/{"version":"ics27-1","controllerConnectionId":"connection-1","hostConnectionId":"connection-1649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-3', + remoteAddress: + '/ibc-hop/connection-1/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-1","hostConnectionId":"connection-1649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-3', + }); // XXX this overrides a previous account, since mocks only provide one address t.is(readLatest('published.basicFlows.agoric1fakeLCAAddress'), ''); diff --git a/packages/boot/test/orchestration/restart-contracts.test.ts b/packages/boot/test/orchestration/restart-contracts.test.ts index f1d28bc0630c..fe6104b6b12e 100644 --- a/packages/boot/test/orchestration/restart-contracts.test.ts +++ b/packages/boot/test/orchestration/restart-contracts.test.ts @@ -141,7 +141,12 @@ test.serial('stakeAtom', async t => { const accountPath = 'published.stakeAtom.accounts.cosmos1test'; t.throws(() => readLatest(accountPath)); t.is(await flushInboundQueue(), 1); - t.is(readLatest(accountPath), ''); + t.deepEqual(readLatest(accountPath), { + localAddress: + '/ibc-port/icacontroller-1/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-1', + remoteAddress: + '/ibc-hop/connection-8/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-1', + }); // request-account is complete const { ATOM } = agoricNamesRemotes.brand; diff --git a/packages/orchestration/src/examples/stakeIca.contract.js b/packages/orchestration/src/examples/stakeIca.contract.js index 91f14ccabe0e..13d6421fb6b5 100644 --- a/packages/orchestration/src/examples/stakeIca.contract.js +++ b/packages/orchestration/src/examples/stakeIca.contract.js @@ -115,17 +115,24 @@ export const start = async (zcf, privateArgs, baggage) => { ? await E(orchestration).provideICQConnection(controllerConnectionId) : undefined; - const accountAddress = await E(account).getAddress(); - trace('account address', accountAddress); + const [chainAddress, localAddress, remoteAddress] = await Promise.all([ + E(account).getAddress(), + E(account).getLocalAddress(), + E(account).getRemoteAddress(), + ]); + trace('account address', chainAddress); const accountNode = await E(accountsStorageNode).makeChildNode( - accountAddress.value, + chainAddress.value, + ); + const holder = makeCosmosOrchestrationAccount( + { chainAddress, bondDenom, localAddress, remoteAddress }, + { + account, + storageNode: accountNode, + icqConnection, + timer, + }, ); - const holder = makeCosmosOrchestrationAccount(accountAddress, bondDenom, { - account, - storageNode: accountNode, - icqConnection, - timer, - }); return holder; } diff --git a/packages/orchestration/src/exos/cosmos-orchestration-account.js b/packages/orchestration/src/exos/cosmos-orchestration-account.js index 1872f85a6309..8af61ed745d1 100644 --- a/packages/orchestration/src/exos/cosmos-orchestration-account.js +++ b/packages/orchestration/src/exos/cosmos-orchestration-account.js @@ -49,6 +49,7 @@ import { makeTimestampHelper } from '../utils/time.js'; * @import {ResponseQuery} from '@agoric/cosmic-proto/tendermint/abci/types.js'; * @import {JsonSafe} from '@agoric/cosmic-proto'; * @import {Matcher} from '@endo/patterns'; + * @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js'; */ const trace = makeTracer('ComosOrchestrationAccountHolder'); @@ -65,12 +66,21 @@ const { Vow$ } = NetworkShape; // TODO #9611 * topicKit: RecorderKit; * account: IcaAccount; * chainAddress: ChainAddress; + * localAddress: LocalIbcAddress; + * remoteAddress: RemoteIbcAddress; * icqConnection: ICQConnection | undefined; * bondDenom: string; * timer: Remote; * }} State */ +/** + * @typedef {{ + * localAddress: LocalIbcAddress; + * remoteAddress: RemoteIbcAddress; + * }} CosmosOrchestrationAccountStorageState + */ + /** @see {OrchestrationAccountI} */ export const IcaAccountHolderI = M.interface('IcaAccountHolder', { ...orchestrationAccountMethods, @@ -178,8 +188,11 @@ export const prepareCosmosOrchestrationAccountKit = ( }), }, /** - * @param {ChainAddress} chainAddress - * @param {string} bondDenom e.g. 'uatom' + * @param {object} info + * @param {ChainAddress} info.chainAddress + * @param {string} info.bondDenom e.g. 'uatom' + * @param {LocalIbcAddress} info.localAddress + * @param {RemoteIbcAddress} info.remoteAddress * @param {object} io * @param {IcaAccount} io.account * @param {Remote} io.storageNode @@ -187,14 +200,29 @@ export const prepareCosmosOrchestrationAccountKit = ( * @param {Remote} io.timer * @returns {State} */ - (chainAddress, bondDenom, io) => { + ({ chainAddress, bondDenom, localAddress, remoteAddress }, io) => { const { storageNode, ...rest } = io; // must be the fully synchronous maker because the kit is held in durable state const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]); // TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066 - void E(topicKit.recorder).write(''); - - return { chainAddress, bondDenom, topicKit, ...rest }; + // XXX consider parsing local/remoteAddr to portId, channelId, counterpartyPortId, counterpartyChannelId, connectionId, counterpartyConnectionId + // FIXME these values will not update if IcaAccount gets new values after reopening. + // consider having IcaAccount responsible for the owning the writer. It might choose to share it with COA. + void E(topicKit.recorder).write( + /** @type {CosmosOrchestrationAccountStorageState} */ ({ + localAddress, + remoteAddress, + }), + ); + + return { + chainAddress, + bondDenom, + localAddress, + remoteAddress, + topicKit, + ...rest, + }; }, { helper: { diff --git a/packages/orchestration/src/exos/remote-chain-facade.js b/packages/orchestration/src/exos/remote-chain-facade.js index 21c2aa0e1710..7cca5e3cb683 100644 --- a/packages/orchestration/src/exos/remote-chain-facade.js +++ b/packages/orchestration/src/exos/remote-chain-facade.js @@ -14,6 +14,7 @@ import { ChainAddressShape, ChainFacadeI, ICQMsgShape } from '../typeGuards.js'; * @import {TimerService} from '@agoric/time'; * @import {Remote} from '@agoric/internal'; * @import {Vow, VowTools} from '@agoric/vow'; + * @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js'; * @import {CosmosInterchainService} from './cosmos-interchain-service.js'; * @import {prepareCosmosOrchestrationAccount} from './cosmos-orchestration-account.js'; * @import {CosmosChainInfo, IBCConnectionInfo, ChainAddress, IcaAccount, Chain, ICQConnection} from '../types.js'; @@ -79,13 +80,18 @@ const prepareRemoteChainFacadeKit = ( ]).returns(VowShape), }, ), - getAddressWatcher: M.interface('getAddressWatcher', { - onFulfilled: M.call(ChainAddressShape, M.remotable()).returns(VowShape), + getAddressesWatcher: M.interface('getAddressWatcher', { + onFulfilled: M.call( + [ChainAddressShape, M.string(), M.string()], + M.remotable(), + ).returns(VowShape), }), makeChildNodeWatcher: M.interface('makeChildNodeWatcher', { onFulfilled: M.call(M.remotable(), { account: M.remotable(), chainAddress: ChainAddressShape, + localAddress: M.string(), + remoteAddress: M.string(), }).returns(M.remotable()), }), }, @@ -170,8 +176,12 @@ const prepareRemoteChainFacadeKit = ( // no need to pass icqConnection in ctx; we can get it from state } return watch( - E(account).getAddress(), - this.facets.getAddressWatcher, + allVows([ + E(account).getAddress(), + E(account).getLocalAddress(), + E(account).getRemoteAddress(), + ]), + this.facets.getAddressesWatcher, account, ); }, @@ -189,16 +199,16 @@ const prepareRemoteChainFacadeKit = ( return watch(E(icqConnection).query(msgs)); }, }, - getAddressWatcher: { + getAddressesWatcher: { /** - * @param {ChainAddress} chainAddress + * @param {[ChainAddress, LocalIbcAddress, RemoteIbcAddress]} chainAddresses * @param {IcaAccount} account */ - onFulfilled(chainAddress, account) { + onFulfilled([chainAddress, localAddress, remoteAddress], account) { return watch( E(storageNode).makeChildNode(chainAddress.value), this.facets.makeChildNodeWatcher, - { account, chainAddress }, + { account, chainAddress, localAddress, remoteAddress }, ); }, }, @@ -208,20 +218,33 @@ const prepareRemoteChainFacadeKit = ( * @param {{ * account: IcaAccount; * chainAddress: ChainAddress; + * localAddress: LocalIbcAddress; + * remoteAddress: RemoteIbcAddress; * }} ctx */ - onFulfilled(childNode, { account, chainAddress }) { + onFulfilled( + childNode, + { account, chainAddress, localAddress, remoteAddress }, + ) { const { remoteChainInfo, icqConnection } = this.state; const stakingDenom = remoteChainInfo.stakingTokens?.[0]?.denom; if (!stakingDenom) throw Fail`chain info lacks staking denom`; - return makeCosmosOrchestrationAccount(chainAddress, stakingDenom, { - account, - // FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066 - storageNode: childNode, - icqConnection, - timer, - }); + return makeCosmosOrchestrationAccount( + { + chainAddress, + bondDenom: stakingDenom, + localAddress, + remoteAddress, + }, + { + account, + // FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066 + storageNode: childNode, + icqConnection, + timer, + }, + ); }, }, }, diff --git a/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.md b/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.md index e82b5bc1faa3..e93a0cae30a2 100644 --- a/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.md +++ b/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.md @@ -11,14 +11,14 @@ Generated by [AVA](https://avajs.dev). Object @Map Iterator { [ 'mockChainStorageRoot.stakeAtom.accounts.cosmos1test', - '{"body":"#\\"\\"","slots":[]}', + '{"body":"#{\\"localAddress\\":\\"/ibc-port/icacontroller-1/ordered/{\\\\\\"version\\\\\\":\\\\\\"ics27-1\\\\\\",\\\\\\"controllerConnectionId\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"hostConnectionId\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"address\\\\\\":\\\\\\"cosmos1test\\\\\\",\\\\\\"encoding\\\\\\":\\\\\\"proto3\\\\\\",\\\\\\"txType\\\\\\":\\\\\\"sdk_multi_msg\\\\\\"}/ibc-channel/channel-0\\",\\"remoteAddress\\":\\"/ibc-hop/connection-8/ibc-port/icahost/ordered/{\\\\\\"version\\\\\\":\\\\\\"ics27-1\\\\\\",\\\\\\"controllerConnectionId\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"hostConnectionId\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"address\\\\\\":\\\\\\"cosmos1test\\\\\\",\\\\\\"encoding\\\\\\":\\\\\\"proto3\\\\\\",\\\\\\"txType\\\\\\":\\\\\\"sdk_multi_msg\\\\\\"}/ibc-channel/channel-0\\"}","slots":[]}', ], [ 'mockChainStorageRoot.stakeAtom.accounts.cosmos1test1', - '{"body":"#\\"\\"","slots":[]}', + '{"body":"#{\\"localAddress\\":\\"/ibc-port/icacontroller-2/ordered/{\\\\\\"version\\\\\\":\\\\\\"ics27-1\\\\\\",\\\\\\"controllerConnectionId\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"hostConnectionId\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"address\\\\\\":\\\\\\"cosmos1test1\\\\\\",\\\\\\"encoding\\\\\\":\\\\\\"proto3\\\\\\",\\\\\\"txType\\\\\\":\\\\\\"sdk_multi_msg\\\\\\"}/ibc-channel/channel-1\\",\\"remoteAddress\\":\\"/ibc-hop/connection-8/ibc-port/icahost/ordered/{\\\\\\"version\\\\\\":\\\\\\"ics27-1\\\\\\",\\\\\\"controllerConnectionId\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"hostConnectionId\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"address\\\\\\":\\\\\\"cosmos1test1\\\\\\",\\\\\\"encoding\\\\\\":\\\\\\"proto3\\\\\\",\\\\\\"txType\\\\\\":\\\\\\"sdk_multi_msg\\\\\\"}/ibc-channel/channel-1\\"}","slots":[]}', ], [ 'mockChainStorageRoot.stakeOsmo.accounts.osmo1test2', - '{"body":"#\\"\\"","slots":[]}', + '{"body":"#{\\"localAddress\\":\\"/ibc-port/icacontroller-3/ordered/{\\\\\\"version\\\\\\":\\\\\\"ics27-1\\\\\\",\\\\\\"controllerConnectionId\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"hostConnectionId\\\\\\":\\\\\\"connection-1649\\\\\\",\\\\\\"address\\\\\\":\\\\\\"osmo1test2\\\\\\",\\\\\\"encoding\\\\\\":\\\\\\"proto3\\\\\\",\\\\\\"txType\\\\\\":\\\\\\"sdk_multi_msg\\\\\\"}/ibc-channel/channel-2\\",\\"remoteAddress\\":\\"/ibc-hop/connection-1/ibc-port/icahost/ordered/{\\\\\\"version\\\\\\":\\\\\\"ics27-1\\\\\\",\\\\\\"controllerConnectionId\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"hostConnectionId\\\\\\":\\\\\\"connection-1649\\\\\\",\\\\\\"address\\\\\\":\\\\\\"osmo1test2\\\\\\",\\\\\\"encoding\\\\\\":\\\\\\"proto3\\\\\\",\\\\\\"txType\\\\\\":\\\\\\"sdk_multi_msg\\\\\\"}/ibc-channel/channel-0\\"}","slots":[]}', ], } diff --git a/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.snap b/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.snap index 5571fd10de5c..96291e4fd799 100644 Binary files a/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.snap and b/packages/orchestration/test/examples/snapshots/stake-ica.contract.test.ts.snap differ diff --git a/packages/orchestration/test/examples/stake-ica.contract.test.ts b/packages/orchestration/test/examples/stake-ica.contract.test.ts index dbc5ba6a4b39..ffcf19973cb4 100644 --- a/packages/orchestration/test/examples/stake-ica.contract.test.ts +++ b/packages/orchestration/test/examples/stake-ica.contract.test.ts @@ -219,14 +219,24 @@ test('makeAccountInvitationMaker', async t => { offerResult.publicSubscribers.account.subscriber, ); const storageUpdate = await E(accountNotifier).getUpdateSince(); + const expectedStorageValue = { + localAddress: + '/ibc-port/icacontroller-1/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-0', + remoteAddress: + '/ibc-hop/connection-8/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-0', + }; + t.deepEqual(storageUpdate, { updateCount: 1n, - value: '', + value: expectedStorageValue, }); const vstorageEntry = bootstrap.storage.data.get( 'mockChainStorageRoot.stakeAtom.accounts.cosmos1test', ); t.truthy(vstorageEntry, 'vstorage account entry created'); - t.is(bootstrap.marshaller.fromCapData(JSON.parse(vstorageEntry!)), ''); + t.deepEqual( + bootstrap.marshaller.fromCapData(JSON.parse(vstorageEntry!)), + expectedStorageValue, + ); }); diff --git a/packages/orchestration/test/exos/make-test-coa-kit.ts b/packages/orchestration/test/exos/make-test-coa-kit.ts index 4cfb283a5801..636ac23baafb 100644 --- a/packages/orchestration/test/exos/make-test-coa-kit.ts +++ b/packages/orchestration/test/exos/make-test-coa-kit.ts @@ -66,15 +66,22 @@ export const prepareMakeTestCOAKit = ( controllerConnectionId, ); - const accountAddress = await E(cosmosOrchAccount).getAddress(); + const [chainAddress, localAddress, remoteAddress] = await Promise.all([ + E(cosmosOrchAccount).getAddress(), + E(cosmosOrchAccount).getLocalAddress(), + E(cosmosOrchAccount).getRemoteAddress(), + ]); t.log('make a CosmosOrchestrationAccount'); - const holder = makeCosmosOrchestrationAccount(accountAddress, bondDenom, { - account: cosmosOrchAccount, - storageNode: storageNode.makeChildNode(accountAddress.value), - icqConnection: undefined, - timer, - }); + const holder = makeCosmosOrchestrationAccount( + { chainAddress, bondDenom, localAddress, remoteAddress }, + { + account: cosmosOrchAccount, + storageNode: storageNode.makeChildNode(chainAddress.value), + icqConnection: undefined, + timer, + }, + ); return holder; }; diff --git a/packages/orchestration/test/staking-ops.test.ts b/packages/orchestration/test/staking-ops.test.ts index 6072295f8134..b7fd62750148 100644 --- a/packages/orchestration/test/staking-ops.test.ts +++ b/packages/orchestration/test/staking-ops.test.ts @@ -45,6 +45,10 @@ test('MsgDelegateResponse trivial response', t => { const configStaking = { acct1: { value: 'agoric1spy36ltduehs5dmszfrp792f0k2emcntrql3nx', + localAddress: + '/ibc-port/icacontroller-1/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-0', + remoteAddress: + '/ibc-hop/connection-8/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-8","hostConnectionId":"connection-649","address":"cosmos1test","encoding":"proto3","txType":"sdk_multi_msg"}/ibc-channel/channel-0', }, validator: { value: 'agoric1valoper234', @@ -153,8 +157,8 @@ const makeScenario = () => { }, executeTx: () => Fail`mock`, deactivate: () => Fail`mock`, - getLocalAddress: () => Fail`mock`, - getRemoteAddress: () => Fail`mock`, + getLocalAddress: () => configStaking.acct1.localAddress, + getRemoteAddress: () => configStaking.acct1.remoteAddress, getPort: () => Fail`mock`, reactivate: () => Fail`mock`, }); @@ -241,12 +245,20 @@ test('makeAccount() writes to storage', async t => { zcf, }); - const { holder } = make(account.getAddress(), 'uatom', { - account, - storageNode, - icqConnection, - timer, - }); + const { holder } = make( + { + chainAddress: account.getAddress(), + localAddress: account.getLocalAddress(), + remoteAddress: account.getRemoteAddress(), + bondDenom: 'uatom', + }, + { + account, + storageNode, + icqConnection, + timer, + }, + ); const { publicSubscribers } = await E.when(holder.asContinuingOffer()); const accountNotifier = makeNotifierFromSubscriber( // @ts-expect-error the promise from `subscriber.getUpdateSince` can't be used in a flow @@ -255,7 +267,10 @@ test('makeAccount() writes to storage', async t => { const storageUpdate = await E(accountNotifier).getUpdateSince(); t.deepEqual(storageUpdate, { updateCount: 1n, - value: '', + value: { + localAddress: configStaking.acct1.localAddress, + remoteAddress: configStaking.acct1.remoteAddress, + }, }); }); @@ -280,12 +295,20 @@ test('withdrawRewards() on StakingAccountHolder formats message correctly', asyn }); // Higher fidelity tests below use invitationMakers. - const { holder } = make(account.getAddress(), 'uatom', { - account, - storageNode, - icqConnection, - timer, - }); + const { holder } = make( + { + chainAddress: account.getAddress(), + localAddress: account.getLocalAddress(), + remoteAddress: account.getRemoteAddress(), + bondDenom: 'uatom', + }, + { + account, + storageNode, + icqConnection, + timer, + }, + ); const { validator } = configStaking; const actual = await E(holder).withdrawReward(validator); t.deepEqual(actual, [{ denom: 'uatom', value: 2n }]); @@ -318,12 +341,20 @@ test(`delegate; redelegate using invitationMakers`, async t => { zcf, }); - const { invitationMakers } = makeAccountKit(account.getAddress(), 'uatom', { - account, - storageNode, - icqConnection, - timer, - }); + const { invitationMakers } = makeAccountKit( + { + chainAddress: account.getAddress(), + localAddress: account.getLocalAddress(), + remoteAddress: account.getRemoteAddress(), + bondDenom: 'uatom', + }, + { + account, + storageNode, + icqConnection, + timer, + }, + ); const { validator, delegations } = configStaking; { @@ -401,12 +432,20 @@ test(`withdraw rewards using invitationMakers`, async t => { zcf, }); - const { invitationMakers } = makeAccountKit(account.getAddress(), 'uatom', { - account, - storageNode, - icqConnection, - timer, - }); + const { invitationMakers } = makeAccountKit( + { + chainAddress: account.getAddress(), + localAddress: account.getLocalAddress(), + remoteAddress: account.getRemoteAddress(), + bondDenom: 'uatom', + }, + { + account, + storageNode, + icqConnection, + timer, + }, + ); const { validator } = configStaking; const toWithdraw = await E(invitationMakers).WithdrawReward(validator); @@ -442,12 +481,20 @@ test(`undelegate waits for unbonding period`, async t => { zcf, }); - const { invitationMakers } = makeAccountKit(account.getAddress(), 'uatom', { - account, - storageNode, - icqConnection, - timer, - }); + const { invitationMakers } = makeAccountKit( + { + chainAddress: account.getAddress(), + localAddress: account.getLocalAddress(), + remoteAddress: account.getRemoteAddress(), + bondDenom: 'uatom', + }, + { + account, + storageNode, + icqConnection, + timer, + }, + ); const { validator, delegations } = configStaking; diff --git a/packages/orchestration/test/types.test-d.ts b/packages/orchestration/test/types.test-d.ts index 894a91938a65..6a0db165743c 100644 --- a/packages/orchestration/test/types.test-d.ts +++ b/packages/orchestration/test/types.test-d.ts @@ -75,7 +75,6 @@ expectNotType(chainAddr); makeCosmosOrchestrationAccount( anyVal, anyVal, - anyVal, ) satisfies HostInterface; }