Skip to content

Commit

Permalink
refactor: use heapVowTools import
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 22, 2024
1 parent 100de68 commit 8cb1ee7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/boot/test/bootstrapTests/ibcClientMock.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file Mock IBC Server */
// @ts-check
import { Far } from '@endo/far';
import { V as E } from '@agoric/vow/vat.js';
import { heapVowE as E } from '@agoric/vow/vat.js';

/**
* @import {Connection, PortAllocator} from '@agoric/network';
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/test/bootstrapTests/ibcServerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @ts-check
import { Far } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { V as E } from '@agoric/vow/vat.js';
import { heapVowE as E } from '@agoric/vow/vat.js';

const { quote: q, Fail } = assert;
const { log } = console;
Expand Down
6 changes: 3 additions & 3 deletions packages/orchestration/src/examples/swapExample.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js'
import { Far } from '@endo/far';
import { deeplyFulfilled } from '@endo/marshal';
import { M, objectMap } from '@endo/patterns';
import { when } from '@agoric/vow/vat.js';
import { heapVowTools } from '@agoric/vow/vat.js';
import { orcUtils } from '../utils/orc.js';
import { provideOrchestration } from '../utils/start-helper.js';

Expand Down Expand Up @@ -97,9 +97,9 @@ export const start = async (zcf, privateArgs, baggage) => {

const [omniAccount, localAccount] = await Promise.all([
// XXX when() until membrane
when(omni.makeAccount()),
heapVowTools.when(omni.makeAccount()),
// XXX when() until membrane
when(agoric.makeAccount()),
heapVowTools.when(agoric.makeAccount()),
]);

const omniAddress = omniAccount.getAddress();
Expand Down
5 changes: 4 additions & 1 deletion packages/orchestration/src/exos/chain-hub.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { VowShape } from '@agoric/vow';
import { allVows, watch } from '@agoric/vow/vat.js';
import { heapVowTools } from '@agoric/vow/vat.js';
import { makeHeapZone } from '@agoric/zone';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { CosmosChainInfoShape, IBCConnectionInfoShape } from '../typeGuards.js';

// FIXME test thoroughly whether heap suffices for ChainHub
const { allVows, watch } = heapVowTools;

const { Fail } = assert;

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/orchestration/src/exos/local-chain-facade.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file ChainAccount exo */
import { V, watch } from '@agoric/vow/vat.js';
import { V, heapVowTools } from '@agoric/vow/vat.js';

import { ChainFacadeI } from '../typeGuards.js';

Expand Down Expand Up @@ -45,7 +45,7 @@ export const prepareLocalChainFacade = (
},
{
getChainInfo() {
return watch(this.state.localChainInfo);
return heapVowTools.watch(this.state.localChainInfo);
},

// FIXME parameterize on the remoteChainInfo to make()
Expand All @@ -55,7 +55,7 @@ export const prepareLocalChainFacade = (
const { localChainInfo } = this.state;
const lcaP = V(localchain).makeAccount();
// FIXME use watch() from vowTools
return watch(allVows([lcaP, V(lcaP).getAddress()]), {
return heapVowTools.watch(allVows([lcaP, E(lcaP).getAddress()]), {
onFulfilled: ([lca, address]) => {
const { holder: account } = makeLocalOrchestrationAccountKit({
account: lca,
Expand Down
6 changes: 3 additions & 3 deletions packages/orchestration/src/exos/remote-chain-facade.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file ChainAccount exo */
import { makeTracer } from '@agoric/internal';
import { V, watch } from '@agoric/vow/vat.js';
import { V, heapVowTools } from '@agoric/vow/vat.js';

import { ChainFacadeI } from '../typeGuards.js';

Expand Down Expand Up @@ -55,7 +55,7 @@ export const prepareRemoteChainFacade = (
},
{
getChainInfo() {
return watch(this.state.remoteChainInfo);
return heapVowTools.watch(this.state.remoteChainInfo);
},

// FIXME parameterize on the remoteChainInfo to make()
Expand All @@ -76,7 +76,7 @@ export const prepareRemoteChainFacade = (
);

// FIXME use watch() from vowTools
return watch(allVows([icaP, V(icaP).getAddress()]), {
return heapVowTools.watch(allVows([icaP, V(icaP).getAddress()]), {
onFulfilled: ([account, address]) => {
return makeCosmosOrchestrationAccount(address, stakingDenom, {
account,
Expand Down
4 changes: 3 additions & 1 deletion packages/vats/src/proposals/network-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { makeScalarBigMapStore } from '@agoric/vat-data';

// Heap-based vow resolution is used for this module because the
// bootstrap vat can't yet be upgraded.
import { when } from '@agoric/vow/vat.js';
import { heapVowTools } from '@agoric/vow/vat.js';

const { when } = heapVowTools;

/**
* @import {ProtocolHandler} from '@agoric/network';
Expand Down

0 comments on commit 8cb1ee7

Please sign in to comment.