@agoric/vats 0.15.2-dev-bd64eda.0 → 0.15.2-dev-3386e64.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/vats",
3
- "version": "0.15.2-dev-bd64eda.0+bd64eda",
3
+ "version": "0.15.2-dev-3386e64.0+3386e64",
4
4
  "description": "Agoric's Vat library",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -22,19 +22,19 @@
22
22
  "author": "Agoric",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@agoric/cosmic-proto": "0.4.1-dev-bd64eda.0+bd64eda",
26
- "@agoric/ertp": "0.16.3-dev-bd64eda.0+bd64eda",
27
- "@agoric/governance": "0.10.4-dev-bd64eda.0+bd64eda",
28
- "@agoric/internal": "0.3.3-dev-bd64eda.0+bd64eda",
29
- "@agoric/network": "0.1.1-dev-bd64eda.0+bd64eda",
30
- "@agoric/notifier": "0.6.3-dev-bd64eda.0+bd64eda",
31
- "@agoric/store": "0.9.3-dev-bd64eda.0+bd64eda",
32
- "@agoric/swingset-vat": "0.32.3-dev-bd64eda.0+bd64eda",
33
- "@agoric/time": "0.3.3-dev-bd64eda.0+bd64eda",
34
- "@agoric/vat-data": "0.5.3-dev-bd64eda.0+bd64eda",
35
- "@agoric/vow": "0.1.1-dev-bd64eda.0+bd64eda",
36
- "@agoric/zoe": "0.26.3-dev-bd64eda.0+bd64eda",
37
- "@agoric/zone": "0.2.3-dev-bd64eda.0+bd64eda",
25
+ "@agoric/cosmic-proto": "0.4.1-dev-3386e64.0+3386e64",
26
+ "@agoric/ertp": "0.16.3-dev-3386e64.0+3386e64",
27
+ "@agoric/governance": "0.10.4-dev-3386e64.0+3386e64",
28
+ "@agoric/internal": "0.3.3-dev-3386e64.0+3386e64",
29
+ "@agoric/network": "0.1.1-dev-3386e64.0+3386e64",
30
+ "@agoric/notifier": "0.6.3-dev-3386e64.0+3386e64",
31
+ "@agoric/store": "0.9.3-dev-3386e64.0+3386e64",
32
+ "@agoric/swingset-vat": "0.32.3-dev-3386e64.0+3386e64",
33
+ "@agoric/time": "0.3.3-dev-3386e64.0+3386e64",
34
+ "@agoric/vat-data": "0.5.3-dev-3386e64.0+3386e64",
35
+ "@agoric/vow": "0.1.1-dev-3386e64.0+3386e64",
36
+ "@agoric/zoe": "0.26.3-dev-3386e64.0+3386e64",
37
+ "@agoric/zone": "0.2.3-dev-3386e64.0+3386e64",
38
38
  "@endo/errors": "^1.2.4",
39
39
  "@endo/far": "^1.1.4",
40
40
  "@endo/import-bundle": "^1.2.1",
@@ -47,7 +47,7 @@
47
47
  "jessie.js": "^0.3.4"
48
48
  },
49
49
  "devDependencies": {
50
- "@agoric/swingset-liveslots": "0.10.3-dev-bd64eda.0+bd64eda",
50
+ "@agoric/swingset-liveslots": "0.10.3-dev-3386e64.0+3386e64",
51
51
  "@endo/bundle-source": "^3.3.0",
52
52
  "@endo/init": "^1.1.3",
53
53
  "ava": "^5.3.0",
@@ -79,5 +79,5 @@
79
79
  "typeCoverage": {
80
80
  "atLeast": 91.52
81
81
  },
82
- "gitHead": "bd64edad25e770a24472bd5bc673e4ab157fead2"
82
+ "gitHead": "3386e64ab3ab6b222b75202d77627d7403186acc"
83
83
  }
@@ -18,6 +18,20 @@
18
18
  * Vow<JsonSafe<MsgTransferResponse & { ...; }>[]>' must have a
19
19
  * '[Symbol.iterator]()' method that returns an iterator.
20
20
  */
21
+ /**
22
+ * Send a batch of query requests to the local chain. Unless there is a system
23
+ * error, will return all results to indicate their success or failure.
24
+ *
25
+ * @template {TypedJson[]} [RT=TypedJson[]]
26
+ * @callback QueryManyFn
27
+ * @param {RT} requests
28
+ * @returns {PromiseVowOfTupleMappedToGenerics<{
29
+ * [K in keyof RT]: JsonSafe<{
30
+ * error?: string;
31
+ * reply: ResponseTo<RT[K]>;
32
+ * }>;
33
+ * }>}
34
+ */
21
35
  /**
22
36
  * @typedef {{
23
37
  * system: ScopedBridgeManager<'vlocalchain'>;
@@ -96,6 +110,7 @@ export function prepareLocalChainAccountKit(zone: import("@agoric/base-zone").Zo
96
110
  * @returns {PromiseVowOfTupleMappedToGenerics<{
97
111
  * [K in keyof MT]: JsonSafe<ResponseTo<MT[K]>>;
98
112
  * }>}
113
+ *
99
114
  * @see {typedJson} which can be used on arguments to get typed return
100
115
  * values.
101
116
  */
@@ -141,23 +156,16 @@ export function prepareLocalChainTools(zone: import("@agoric/base-zone").Zone, v
141
156
  query<T extends TypedJson = {
142
157
  '@type': string;
143
158
  }>(request: T): PromiseVow<JsonSafe<ResponseTo<T>>>;
144
- /**
145
- * Send a batch of query requests to the local chain. Unless there is a
146
- * system error, will return all results to indicate their success or
147
- * failure.
148
- *
149
- * @template {import('@agoric/cosmic-proto').TypedJson[]} RT
150
- * @param {RT} requests
151
- * @returns {PromiseVowOfTupleMappedToGenerics<{
152
- * [K in keyof RT]: JsonSafe<{
153
- * error?: string;
154
- * reply: ResponseTo<RT[K]>;
155
- * }>;
156
- * }>}
157
- */
158
- queryMany<RT extends import("@agoric/cosmic-proto").TypedJson[]>(requests: RT): PromiseVowOfTupleMappedToGenerics<{ [K in keyof RT]: JsonSafe<{
159
+ /** @type {QueryManyFn} */
160
+ queryMany(requests: {
161
+ '@type': string;
162
+ }[]): PromiseVowOfTupleMappedToGenerics<{ [K in keyof {
163
+ '@type': string;
164
+ }[]]: JsonSafe<{
159
165
  error?: string;
160
- reply: ResponseTo<RT[K]>;
166
+ reply: ResponseTo<{
167
+ '@type': string;
168
+ }[][K]>;
161
169
  }>; }>;
162
170
  }>;
163
171
  };
@@ -174,6 +182,16 @@ export function prepareLocalChainTools(zone: import("@agoric/base-zone").Zone, v
174
182
  * '[Symbol.iterator]()' method that returns an iterator.
175
183
  */
176
184
  export type PromiseVowOfTupleMappedToGenerics<T extends unknown[]> = Promise<T>;
185
+ /**
186
+ * Send a batch of query requests to the local chain. Unless there is a system
187
+ * error, will return all results to indicate their success or failure.
188
+ */
189
+ export type QueryManyFn<RT extends TypedJson[] = {
190
+ '@type': string;
191
+ }[]> = (requests: RT) => PromiseVowOfTupleMappedToGenerics<{ [K in keyof RT]: JsonSafe<{
192
+ error?: string;
193
+ reply: ResponseTo<RT[K]>;
194
+ }>; }>;
177
195
  export type AccountPowers = {
178
196
  system: ScopedBridgeManager<"vlocalchain">;
179
197
  bank: Bank;
@@ -1 +1 @@
1
- {"version":3,"file":"localchain.d.ts","sourceRoot":"","sources":["localchain.js"],"names":[],"mappings":"AAcA;;;;;;GAMG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAaG;AAMI,kDAHI,OAAO,mBAAmB,EAAE,IAAI,aAChC,QAAQ;;QA2BX;;;;;;WAMG;2BALQ,KAAK,CAAC,KAAK,CAAC,+BACZ;YACV,OAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5B,cAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;SAC/B;;;;QAYJ;;;WAGG;0BAFQ,KAAK,CAAC,KAAK,CAAC,GACV,WAAW,MAAM,CAAC,KAAK,CAAC,CAAC;QAUtC;;;;;;;;;WASG;yBAJQ,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,mBACpB,OAAO,GAEL,WAAW,MAAM,CAAC,KAAK,CAAC,CAAC;QAYtC;;;;;;WAMG;yBAFQ,MAAM,CAAC,KAAK,CAAC,GACX,WAAW,OAAO,CAAC,KAAK,CAAC,CAAC;QAOvC;;;;;;;;;;;;;;;;;;WAkBG;kBARwB,EAAE,SAAf,SAAS,EAAG,YAEf,EAAE,GACA,iCAAiC,CAAC,GACzC,CAAa,IAAR,MAAM,EAAE,GAAG,SAAS,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAC7C,CAAC;QAkBL;;;WAGG;8BAFQ,SAAS,GACP,WAAW,kBAAkB,CAAC;;GAQhD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etworkShape;
34
34
  * '[Symbol.iterator]()' method that returns an iterator.
35
35
  */
36
36
 
37
+ /**
38
+ * Send a batch of query requests to the local chain. Unless there is a system
39
+ * error, will return all results to indicate their success or failure.
40
+ *
41
+ * @template {TypedJson[]} [RT=TypedJson[]]
42
+ * @callback QueryManyFn
43
+ * @param {RT} requests
44
+ * @returns {PromiseVowOfTupleMappedToGenerics<{
45
+ * [K in keyof RT]: JsonSafe<{
46
+ * error?: string;
47
+ * reply: ResponseTo<RT[K]>;
48
+ * }>;
49
+ * }>}
50
+ */
51
+
37
52
  /**
38
53
  * @typedef {{
39
54
  * system: ScopedBridgeManager<'vlocalchain'>;
@@ -171,6 +186,7 @@ export const prepareLocalChainAccountKit = (zone, { watch }) =>
171
186
  * @returns {PromiseVowOfTupleMappedToGenerics<{
172
187
  * [K in keyof MT]: JsonSafe<ResponseTo<MT[K]>>;
173
188
  * }>}
189
+ *
174
190
  * @see {typedJson} which can be used on arguments to get typed return
175
191
  * values.
176
192
  */
@@ -271,20 +287,7 @@ const prepareLocalChain = (zone, makeAccountKit, { watch }) => {
271
287
  this.facets.extractFirstQueryResultWatcher,
272
288
  );
273
289
  },
274
- /**
275
- * Send a batch of query requests to the local chain. Unless there is a
276
- * system error, will return all results to indicate their success or
277
- * failure.
278
- *
279
- * @template {import('@agoric/cosmic-proto').TypedJson[]} RT
280
- * @param {RT} requests
281
- * @returns {PromiseVowOfTupleMappedToGenerics<{
282
- * [K in keyof RT]: JsonSafe<{
283
- * error?: string;
284
- * reply: ResponseTo<RT[K]>;
285
- * }>;
286
- * }>}
287
- */
290
+ /** @type {QueryManyFn} */
288
291
  async queryMany(requests) {
289
292
  const { system } = this.state;
290
293
  return E(system).toBridge({
@@ -10,9 +10,15 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
10
10
  query<T extends import("@agoric/cosmic-proto").TypedJson = {
11
11
  '@type': string;
12
12
  }>(request: T): import("@agoric/vow").PromiseVow<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<T>>>;
13
- queryMany<RT extends import("@agoric/cosmic-proto").TypedJson[]>(requests: RT): PromiseVowOfTupleMappedToGenerics<{ [K in keyof RT]: import("@agoric/cosmic-proto").JsonSafe<{
13
+ queryMany(requests: {
14
+ '@type': string;
15
+ }[]): import("./localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof {
16
+ '@type': string;
17
+ }[]]: import("@agoric/cosmic-proto").JsonSafe<{
14
18
  error?: string;
15
- reply: import("@agoric/cosmic-proto").ResponseTo<RT[K]>;
19
+ reply: import("@agoric/cosmic-proto").ResponseTo<{
20
+ '@type': string;
21
+ }[][K]>;
16
22
  }>; }>;
17
23
  }>;
18
24
  } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -27,9 +33,15 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
27
33
  query<T extends import("@agoric/cosmic-proto").TypedJson = {
28
34
  '@type': string;
29
35
  }>(request: T): import("@agoric/vow").PromiseVow<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<T>>>;
30
- queryMany<RT extends import("@agoric/cosmic-proto").TypedJson[]>(requests: RT): PromiseVowOfTupleMappedToGenerics<{ [K in keyof RT]: import("@agoric/cosmic-proto").JsonSafe<{
36
+ queryMany(requests: {
37
+ '@type': string;
38
+ }[]): import("./localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof {
39
+ '@type': string;
40
+ }[]]: import("@agoric/cosmic-proto").JsonSafe<{
31
41
  error?: string;
32
- reply: import("@agoric/cosmic-proto").ResponseTo<RT[K]>;
42
+ reply: import("@agoric/cosmic-proto").ResponseTo<{
43
+ '@type': string;
44
+ }[][K]>;
33
45
  }>; }>;
34
46
  }>;
35
47
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"vat-localchain.d.ts","sourceRoot":"","sources":["vat-localchain.js"],"names":[],"mappings":"AAOO;IASH;;;;;OAKG;2BADQ,OAAO,iBAAiB,EAAE,gBAAgB;;;;;oCASwzQ,sBAAsB;iBAAwK,CAAC;;;;;IAb5iR;;;;;OAKG;2BADQ,OAAO,iBAAiB,EAAE,gBAAgB;;;;;;iBASs/Q,CAAC;;;;GAH/iR;4BAEa,UAAU,CAAC,OAAO,eAAe,CAAC"}
1
+ {"version":3,"file":"vat-localchain.d.ts","sourceRoot":"","sources":["vat-localchain.js"],"names":[],"mappings":"AAOO;IASH;;;;;OAKG;2BADQ,OAAO,iBAAiB,EAAE,gBAAgB;;;;;;;;;;iBASuiB,CAAC;;;;;;;IAb7lB;;;;;OAKG;2BADQ,OAAO,iBAAiB,EAAE,gBAAgB;;;;;;;;;;iBASuiB,CAAC;;;;;;GAHhmB;4BAEa,UAAU,CAAC,OAAO,eAAe,CAAC"}
@@ -10,6 +10,7 @@ export namespace SIMULATED_ERRORS {
10
10
  let BAD_REQUEST: bigint;
11
11
  }
12
12
  export function fakeLocalChainBridgeTxMsgHandler(message: object, sequence: number): unknown;
13
+ export function fakeLocalChainBridgeQueryHandler(message: object): unknown;
13
14
  export function makeFakeLocalchainBridge(zone: import("@agoric/zone").Zone, onToBridge?: ((obj: any) => void) | undefined): ScopedBridgeManager<"vlocalchain">;
14
15
  export function makeFakeTransferBridge(zone: import("@agoric/zone").Zone, onToBridge?: ((obj: any) => void) | undefined): ScopedBridgeManager<"vtransfer">;
15
16
  export type Balances = {
@@ -1 +1 @@
1
- {"version":3,"file":"fake-bridge.d.ts","sourceRoot":"","sources":["fake-bridge.js"],"names":[],"mappings":"AAkBA,6EAA6E;AAE7E,sCAAuC;AAchC,yCANI,OAAO,cAAc,EAAE,IAAI,SAEnC;IAAuB,QAAQ,EAAvB,QAAQ;CAChB,GAAU,oBAAoB,MAAM,CAAC,CA0FvC;AAOM,wCAJI,OAAO,cAAc,EAAE,IAAI,cAC3B,CAAC,GAAG,KAAA,KAAK,IAAI,GACX,oBAAoB,MAAM,CAAC,CAwCvC;AAED,iEAAkE;;;;;AAwB3D,0DALI,MAAM,YACN,MAAM,GACJ,OAAO,CAsCnB;AAOM,+CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,aAAa,CAAC,CA2C9C;AAOM,6CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,WAAW,CAAC,CAuC5C;uBA7Sa;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAAE;yCAPX,iBAAiB"}
1
+ {"version":3,"file":"fake-bridge.d.ts","sourceRoot":"","sources":["fake-bridge.js"],"names":[],"mappings":"AAkBA,6EAA6E;AAE7E,sCAAuC;AAchC,yCANI,OAAO,cAAc,EAAE,IAAI,SAEnC;IAAuB,QAAQ,EAAvB,QAAQ;CAChB,GAAU,oBAAoB,MAAM,CAAC,CA0FvC;AAOM,wCAJI,OAAO,cAAc,EAAE,IAAI,cAC3B,CAAC,GAAG,KAAA,KAAK,IAAI,GACX,oBAAoB,MAAM,CAAC,CAwCvC;AAED,iEAAkE;;;;;AAwB3D,0DALI,MAAM,YACN,MAAM,GACJ,OAAO,CAsCnB;AAWM,0DAHI,MAAM,GACJ,OAAO,CAyCnB;AAOM,+CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,aAAa,CAAC,CAgD9C;AAOM,6CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,WAAW,CAAC,CAuC5C;uBApWa;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAAE;yCAPX,iBAAiB"}
@@ -227,6 +227,56 @@ export const fakeLocalChainBridgeTxMsgHandler = (message, sequence) => {
227
227
  }
228
228
  };
229
229
 
230
+ /**
231
+ * Used to mock responses from Cosmos Golang back to SwingSet for for
232
+ * E(lca).query() and E(lca).queryMany().
233
+ *
234
+ * Returns an empty object per query message unless specified.
235
+ *
236
+ * @param {object} message
237
+ * @returns {unknown}
238
+ */
239
+ export const fakeLocalChainBridgeQueryHandler = message => {
240
+ switch (message['@type']) {
241
+ case '/cosmos.bank.v1beta1.QueryAllBalancesRequest': {
242
+ return {
243
+ error: '',
244
+ height: '1',
245
+ reply: {
246
+ '@type': '/cosmos.bank.v1beta1.QueryAllBalancesResponse',
247
+ balances: [
248
+ {
249
+ amount: '10',
250
+ denom: 'ubld',
251
+ },
252
+ {
253
+ amount: '10',
254
+ denom: 'uist',
255
+ },
256
+ ],
257
+ pagination: { nextKey: null, total: '2' },
258
+ },
259
+ };
260
+ }
261
+ case '/cosmos.bank.v1beta1.QueryBalanceRequest': {
262
+ return {
263
+ error: '',
264
+ height: '1',
265
+ reply: {
266
+ '@type': '/cosmos.bank.v1beta1.QueryBalanceResponse',
267
+ balance: {
268
+ amount: '10',
269
+ denom: 'ubld',
270
+ },
271
+ },
272
+ };
273
+ }
274
+ // returns one empty object per message unless specified
275
+ default:
276
+ return {};
277
+ }
278
+ };
279
+
230
280
  /**
231
281
  * @param {import('@agoric/zone').Zone} zone
232
282
  * @param {(obj) => void} [onToBridge]
@@ -255,6 +305,11 @@ export const makeFakeLocalchainBridge = (zone, onToBridge = () => {}) => {
255
305
  fakeLocalChainBridgeTxMsgHandler(message, lcaExecuteTxSequence),
256
306
  );
257
307
  }
308
+ case 'VLOCALCHAIN_QUERY_MANY': {
309
+ return obj.messages.map(message =>
310
+ fakeLocalChainBridgeQueryHandler(message),
311
+ );
312
+ }
258
313
  default:
259
314
  Fail`unknown type ${type}`;
260
315
  }