Skip to content

Commit

Permalink
fixup! chore(test-swap-wallet): restore to working order with gov
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Mar 18, 2024
1 parent cfbf968 commit 9b7ddab
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions contract/test/test-swap-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import {
installSwapContract,
permit,
startSwapContract,
startSwaparooCharter,
} from '../src/swaparoo.proposal.js';
import { makeStableFaucet } from './mintStable.js';
import { mockWalletFactory, seatLike } from './wallet-tools.js';
import { getBundleId, makeBundleCacheContext } from '../tools/bundle-tools.js';
import {
installPuppetGovernance,
mockElectorate,
assets as govAssets,
} from './lib-gov-test/puppet-gov.js';

/** @typedef {import('./wallet-tools.js').MockWallet} MockWallet */
Expand All @@ -35,6 +37,16 @@ const makeTestContext = async t => {
const bc = await makeBundleCacheContext(t);
t.log('bootstrap');
const { powers, vatAdminState } = await mockBootstrapPowers(t.log);

const { zoe } = powers.consume;
for await (const [name, asset] of Object.entries({
econCommitteeCharter: govAssets.committeeCharter,
})) {
powers.installation.produce[name].resolve(
E(zoe).install(await bc.bundleCache.load(asset)),
);
}

return { ...bc, powers, vatAdminState };
};

Expand Down Expand Up @@ -76,13 +88,22 @@ test.serial('start contract', async t => {
t.log('start contract, checking permit');
const permittedPowers = extractPowers(permit, powers);

await startSwapContract(permittedPowers);
const config = {
options: {
[`${contractName}Committee`]: {
voterAddresses: {},
},
},
};

await Promise.all([
startSwaparooCharter(permittedPowers, config),
startSwapContract(permittedPowers),
]);

const instance = await powers.instance.consume[contractName];
t.log(instance);
t.is(typeof instance, 'object');

Object.assign(t.context.shared, { powers });
});

/**
Expand Down

0 comments on commit 9b7ddab

Please sign in to comment.