diff --git a/packages/orchestration/src/examples/stakeBld.contract.js b/packages/orchestration/src/examples/stakeBld.contract.js index 969ad3a88ed..cf282ee650b 100644 --- a/packages/orchestration/src/examples/stakeBld.contract.js +++ b/packages/orchestration/src/examples/stakeBld.contract.js @@ -2,16 +2,16 @@ * @file Stake BLD contract */ import { makeTracer } from '@agoric/internal'; +import { heapVowE as E, prepareVowTools } from '@agoric/vow/vat.js'; import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js'; import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js'; import { InvitationShape } from '@agoric/zoe/src/typeGuards.js'; import { makeDurableZone } from '@agoric/zone/durable.js'; -import { prepareVowTools, heapVowE as E } from '@agoric/vow/vat.js'; import { deeplyFulfilled } from '@endo/marshal'; import { M } from '@endo/patterns'; -import { prepareLocalOrchestrationAccountKit } from '../exos/local-orchestration-account.js'; import { makeChainHub } from '../exos/chain-hub.js'; -import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js'; +import { prepareLocalOrchestrationAccountKit } from '../exos/local-orchestration-account.js'; +import fetchedChainInfo from '../fetched-chain-info.js'; /** * @import {NameHub} from '@agoric/vats'; @@ -59,6 +59,15 @@ export const start = async (zcf, privateArgs, baggage) => { const BLD = zcf.getTerms().brands.In; const bldAmountShape = await E(BLD).getAmountShape(); + // XXX big dependency, will probably already be registered in agoricNames + chainHub.registerChain('agoric', fetchedChainInfo.agoric); + chainHub.registerAsset('ubld', { + baseName: 'agoric', + baseDenom: 'ubld', + brand: BLD, + chainName: 'agoric', + }); + async function makeLocalAccountKit() { const account = await E(privateArgs.localchain).makeAccount(); const address = await E(account).getAddress(); @@ -124,6 +133,6 @@ export const start = async (zcf, privateArgs, baggage) => { }, ); - return { creatorFacet: prepareChainHubAdmin(zone, chainHub), publicFacet }; + return { publicFacet }; }; harden(start); diff --git a/packages/orchestration/test/examples/stake-bld.contract.test.ts b/packages/orchestration/test/examples/stake-bld.contract.test.ts index 85c132ad68d..7af3470583d 100644 --- a/packages/orchestration/test/examples/stake-bld.contract.test.ts +++ b/packages/orchestration/test/examples/stake-bld.contract.test.ts @@ -8,7 +8,6 @@ import { setUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js'; import path from 'path'; import type { CosmosChainInfo } from '../../src/cosmos-api.js'; import { commonSetup } from '../supports.js'; -import knownChains from '../../src/fetched-chain-info.js'; const dirname = path.dirname(new URL(import.meta.url).pathname); @@ -34,7 +33,7 @@ const startContract = async ({ const installation: Installation = await bundleAndInstall(contractFile); - const { creatorFacet, publicFacet } = await E(zoe).startInstance( + const { publicFacet } = await E(zoe).startInstance( installation, { In: bld.issuer }, {}, @@ -46,7 +45,7 @@ const startContract = async ({ timerService: timer, }, ); - return { creatorFacet, publicFacet, zoe }; + return { publicFacet, zoe }; }; test('makeAccount, deposit, withdraw', async t => { @@ -55,7 +54,7 @@ test('makeAccount, deposit, withdraw', async t => { brands: { bld }, utils, } = await commonSetup(t); - const { creatorFacet, publicFacet } = await startContract({ + const { publicFacet } = await startContract({ ...bootstrap, bld, }); @@ -68,16 +67,6 @@ test('makeAccount, deposit, withdraw', async t => { const depositResp = await E(account).deposit( await utils.pourPayment(bld.units(100)), ); - await t.throwsAsync(E(account).getBalance('ubld'), { - message: '"denom" not found: "ubld"', - }); - // try again after registering the asset - await E(creatorFacet).registerAsset('ubld', { - baseName: 'agoric', - baseDenom: 'ubld', - brand: bld.brand, - chainName: 'agoric', - }); t.deepEqual(await E(account).getBalance('ubld'), { denom: 'ubld', value: bld.units(100).value, @@ -104,7 +93,7 @@ test('makeStakeBldInvitation', async t => { brands: { bld }, utils, } = await commonSetup(t); - const { creatorFacet, publicFacet, zoe } = await startContract({ + const { publicFacet, zoe } = await startContract({ ...bootstrap, bld, }); @@ -124,13 +113,6 @@ test('makeStakeBldInvitation', async t => { const { invitationMakers } = await E(userSeat).getOfferResult(); t.truthy(invitationMakers, 'received continuing invitation'); - await E(creatorFacet).registerAsset('ubld', { - baseName: 'agoric', - baseDenom: 'ubld', - brand: bld.brand, - chainName: 'agoric', - }); - t.log('make Delegate offer using invitationMakers'); { const delegateInv = await E(invitationMakers).Delegate(