@agoric/cosmic-swingset 0.41.4-dev-0c96ea5.0 → 0.41.4-dev-bf791ed.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +11 -11
  2. package/src/launch-chain.js +13 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/cosmic-swingset",
3
- "version": "0.41.4-dev-0c96ea5.0+0c96ea5",
3
+ "version": "0.41.4-dev-bf791ed.0+bf791ed",
4
4
  "description": "Agoric's Cosmos blockchain integration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,15 +22,15 @@
22
22
  "author": "Agoric",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@agoric/builders": "0.1.1-dev-0c96ea5.0+0c96ea5",
26
- "@agoric/cosmos": "0.34.2-dev-0c96ea5.0+0c96ea5",
27
- "@agoric/deploy-script-support": "0.10.4-dev-0c96ea5.0+0c96ea5",
28
- "@agoric/internal": "0.3.3-dev-0c96ea5.0+0c96ea5",
29
- "@agoric/store": "0.9.3-dev-0c96ea5.0+0c96ea5",
30
- "@agoric/swing-store": "0.9.2-dev-0c96ea5.0+0c96ea5",
31
- "@agoric/swingset-vat": "0.32.3-dev-0c96ea5.0+0c96ea5",
32
- "@agoric/telemetry": "0.6.3-dev-0c96ea5.0+0c96ea5",
33
- "@agoric/vm-config": "0.1.1-dev-0c96ea5.0+0c96ea5",
25
+ "@agoric/builders": "0.1.1-dev-bf791ed.0+bf791ed",
26
+ "@agoric/cosmos": "0.34.2-dev-bf791ed.0+bf791ed",
27
+ "@agoric/deploy-script-support": "0.10.4-dev-bf791ed.0+bf791ed",
28
+ "@agoric/internal": "0.3.3-dev-bf791ed.0+bf791ed",
29
+ "@agoric/store": "0.9.3-dev-bf791ed.0+bf791ed",
30
+ "@agoric/swing-store": "0.9.2-dev-bf791ed.0+bf791ed",
31
+ "@agoric/swingset-vat": "0.32.3-dev-bf791ed.0+bf791ed",
32
+ "@agoric/telemetry": "0.6.3-dev-bf791ed.0+bf791ed",
33
+ "@agoric/vm-config": "0.1.1-dev-bf791ed.0+bf791ed",
34
34
  "@endo/bundle-source": "^3.2.3",
35
35
  "@endo/env-options": "^1.1.4",
36
36
  "@endo/errors": "^1.2.2",
@@ -70,5 +70,5 @@
70
70
  "typeCoverage": {
71
71
  "atLeast": 80.6
72
72
  },
73
- "gitHead": "0c96ea5a63bb001d5f11e99a1fa58de4cce475c1"
73
+ "gitHead": "bf791ed1c7dac4e69fefd5bf478724a273679579"
74
74
  }
@@ -96,7 +96,7 @@ const getHostKey = path => `host.${path}`;
96
96
 
97
97
  /**
98
98
  * @param {Map<*, *>} mailboxStorage
99
- * @param {undefined | ((dstID: string, obj: any) => any)} bridgeOutbound
99
+ * @param {((dstID: string, obj: any) => any)} bridgeOutbound
100
100
  * @param {SwingStoreKernelStorage} kernelStorage
101
101
  * @param {string | (() => string | Promise<string>)} vatconfig absolute path or thunk
102
102
  * @param {unknown} bootstrapArgs JSON-serializable data
@@ -123,17 +123,15 @@ export async function buildSwingset(
123
123
  const debugPrefix = debugName === undefined ? '' : `${debugName}:`;
124
124
  const mbs = buildMailboxStateMap(mailboxStorage);
125
125
 
126
- const bridgeDevice = bridgeOutbound && buildBridge(bridgeOutbound);
126
+ const bridgeDevice = buildBridge(bridgeOutbound);
127
127
  const mailboxDevice = buildMailbox(mbs);
128
128
  const timerDevice = buildTimer();
129
129
 
130
130
  const deviceEndowments = {
131
131
  mailbox: { ...mailboxDevice.endowments },
132
132
  timer: { ...timerDevice.endowments },
133
+ bridge: { ...bridgeDevice.endowments },
133
134
  };
134
- if (bridgeDevice) {
135
- deviceEndowments.bridge = { ...bridgeDevice.endowments };
136
- }
137
135
 
138
136
  async function ensureSwingsetInitialized() {
139
137
  if (swingsetIsInitialized(kernelStorage)) {
@@ -175,18 +173,16 @@ export async function buildSwingset(
175
173
  const bootVat =
176
174
  swingsetConfig.vats[swingsetConfig.bootstrap || 'bootstrap'];
177
175
 
178
- if (bridgeOutbound) {
179
- const batchChainStorage = (method, args) =>
180
- bridgeOutbound(BRIDGE_ID.STORAGE, { method, args });
176
+ const batchChainStorage = (method, args) =>
177
+ bridgeOutbound(BRIDGE_ID.STORAGE, { method, args });
181
178
 
182
- // Extract data from chain storage as [path, value?] pairs.
183
- const chainStorageEntries = exportStorage(
184
- batchChainStorage,
185
- exportStorageSubtrees,
186
- clearStorageSubtrees,
187
- );
188
- bootVat.parameters = { ...bootVat.parameters, chainStorageEntries };
189
- }
179
+ // Extract data from chain storage as [path, value?] pairs.
180
+ const chainStorageEntries = exportStorage(
181
+ batchChainStorage,
182
+ exportStorageSubtrees,
183
+ clearStorageSubtrees,
184
+ );
185
+ bootVat.parameters = { ...bootVat.parameters, chainStorageEntries };
190
186
 
191
187
  // Since only on-chain swingsets like `agd` have a bridge (and thereby
192
188
  // `CORE_EVAL` support), things like `ag-solo` will need to do the
@@ -238,7 +234,7 @@ export async function buildSwingset(
238
234
  coreProposals,
239
235
  controller,
240
236
  mb: mailboxDevice,
241
- bridgeInbound: bridgeDevice && bridgeDevice.deliverInbound,
237
+ bridgeInbound: bridgeDevice.deliverInbound,
242
238
  timer: timerDevice,
243
239
  };
244
240
  }