diff --git a/multichain-testing/test/basic-flows.test.ts b/multichain-testing/test/basic-flows.test.ts index 8db6ef7c84e..658ce851d67 100644 --- a/multichain-testing/test/basic-flows.test.ts +++ b/multichain-testing/test/basic-flows.test.ts @@ -16,12 +16,15 @@ const contractBuilder = '../packages/builders/scripts/orchestration/init-basic-flows.js'; test.before(async t => { - const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t); + const { setupTestKeys, ...common } = await commonSetup(t); + const { assetInfo, chainInfo, deleteTestKeys, startContract } = common; deleteTestKeys(accounts).catch(); const wallets = await setupTestKeys(accounts); - t.context = { ...rest, wallets, deleteTestKeys }; - const { startContract } = rest; - await startContract(contractName, contractBuilder); + t.context = { ...common, wallets }; + await startContract(contractName, contractBuilder, { + chainInfo: JSON.stringify(chainInfo), + assetInfo: JSON.stringify(assetInfo), + }); }); test.after(async t => { diff --git a/multichain-testing/test/deposit-withdraw-lca.test.ts b/multichain-testing/test/deposit-withdraw-lca.test.ts index 9ba574dff56..226b29d45dd 100644 --- a/multichain-testing/test/deposit-withdraw-lca.test.ts +++ b/multichain-testing/test/deposit-withdraw-lca.test.ts @@ -14,12 +14,15 @@ const contractBuilder = '../packages/builders/scripts/orchestration/init-basic-flows.js'; test.before(async t => { - const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t); + const { setupTestKeys, ...common } = await commonSetup(t); + const { assetInfo, chainInfo, deleteTestKeys, startContract } = common; deleteTestKeys(accounts).catch(); const wallets = await setupTestKeys(accounts); - t.context = { ...rest, wallets, deleteTestKeys }; - const { startContract } = rest; - await startContract(contractName, contractBuilder); + t.context = { ...common, wallets }; + await startContract(contractName, contractBuilder, { + chainInfo: JSON.stringify(chainInfo), + assetInfo: JSON.stringify(assetInfo), + }); }); test.after(async t => { diff --git a/multichain-testing/test/deposit-withdraw-portfolio.test.ts b/multichain-testing/test/deposit-withdraw-portfolio.test.ts index 24bb5277a80..afd484284b8 100644 --- a/multichain-testing/test/deposit-withdraw-portfolio.test.ts +++ b/multichain-testing/test/deposit-withdraw-portfolio.test.ts @@ -14,12 +14,15 @@ const contractBuilder = '../packages/builders/scripts/orchestration/init-basic-flows.js'; test.before(async t => { - const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t); + const { setupTestKeys, ...common } = await commonSetup(t); + const { assetInfo, chainInfo, deleteTestKeys, startContract } = common; deleteTestKeys(accounts).catch(); const wallets = await setupTestKeys(accounts); - t.context = { ...rest, wallets, deleteTestKeys }; - const { startContract } = rest; - await startContract(contractName, contractBuilder); + t.context = { ...common, wallets }; + await startContract(contractName, contractBuilder, { + chainInfo: JSON.stringify(chainInfo), + assetInfo: JSON.stringify(assetInfo), + }); }); test.after(async t => { diff --git a/multichain-testing/test/ica-channel-close.test.ts b/multichain-testing/test/ica-channel-close.test.ts index 9e844fa903b..ab7437da525 100644 --- a/multichain-testing/test/ica-channel-close.test.ts +++ b/multichain-testing/test/ica-channel-close.test.ts @@ -22,12 +22,15 @@ const contractBuilder = '../packages/builders/scripts/orchestration/init-basic-flows.js'; test.before(async t => { - const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t); + const { setupTestKeys, ...common } = await commonSetup(t); + const { assetInfo, chainInfo, deleteTestKeys, startContract } = common; deleteTestKeys(accounts).catch(); const wallets = await setupTestKeys(accounts); - t.context = { ...rest, wallets, deleteTestKeys }; - const { startContract } = rest; - await startContract(contractName, contractBuilder); + t.context = { ...common, wallets }; + await startContract(contractName, contractBuilder, { + chainInfo: JSON.stringify(chainInfo), + assetInfo: JSON.stringify(assetInfo), + }); }); test.after(async t => { diff --git a/multichain-testing/test/tools/asset-info.test.ts b/multichain-testing/test/tools/asset-info.test.ts index f12748de7fd..be054b65180 100644 --- a/multichain-testing/test/tools/asset-info.test.ts +++ b/multichain-testing/test/tools/asset-info.test.ts @@ -80,6 +80,7 @@ test('makeAssetInfo', async t => { { baseDenom: 'uist', baseName: 'agoric', + brandKey: 'IST', chainName: 'agoric', }, ], @@ -88,6 +89,7 @@ test('makeAssetInfo', async t => { { baseDenom: 'ubld', baseName: 'agoric', + brandKey: 'BLD', chainName: 'agoric', }, ], diff --git a/multichain-testing/tools/asset-info.ts b/multichain-testing/tools/asset-info.ts index 34c7d536b8c..f3e548d1968 100644 --- a/multichain-testing/tools/asset-info.ts +++ b/multichain-testing/tools/asset-info.ts @@ -37,6 +37,13 @@ export const makeAssetInfo = ( return `ibc/${denomHash({ denom, channelId })}`; }; + // `brandKey` instead of `brand` until #10580 + // only BLD, IST until #9966 + const BRAND_KEY_MAP: Record = { + ubld: 'BLD', + uist: 'IST', + }; + // only include chains present in `chainInfo` const tokens = Object.entries(tokenMap) .filter(([chain]) => chain in chainInfo) @@ -55,6 +62,7 @@ export const makeAssetInfo = ( { ...baseDetails, chainName: chain, + ...(BRAND_KEY_MAP[denom] && { brandKey: BRAND_KEY_MAP[denom] }), }, ]); @@ -62,11 +70,15 @@ export const makeAssetInfo = ( const issuingChainId = chainInfo[chain].chainId; for (const holdingChain of Object.keys(chainInfo)) { if (holdingChain === chain) continue; + const denomHash = toDenomHash(denom, issuingChainId, holdingChain); assetInfo.push([ - toDenomHash(denom, issuingChainId, holdingChain), + denomHash, { ...baseDetails, chainName: holdingChain, + ...(BRAND_KEY_MAP[denomHash] && { + brandKey: BRAND_KEY_MAP[denomHash], + }), }, ]); }