@agoric/casting 0.4.3-dev-4c9a859.0 → 0.4.3-dev-c74c628.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/casting",
3
- "version": "0.4.3-dev-4c9a859.0+4c9a859",
3
+ "version": "0.4.3-dev-c74c628.0+c74c628",
4
4
  "description": "Agoric's OCap broadcasting system",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -22,10 +22,10 @@
22
22
  "author": "Agoric",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@agoric/internal": "0.3.3-dev-4c9a859.0+4c9a859",
26
- "@agoric/notifier": "0.6.3-dev-4c9a859.0+4c9a859",
27
- "@agoric/spawner": "0.6.9-dev-4c9a859.0+4c9a859",
28
- "@agoric/store": "0.9.3-dev-4c9a859.0+4c9a859",
25
+ "@agoric/internal": "0.3.3-dev-c74c628.0+c74c628",
26
+ "@agoric/notifier": "0.6.3-dev-c74c628.0+c74c628",
27
+ "@agoric/spawner": "0.6.9-dev-c74c628.0+c74c628",
28
+ "@agoric/store": "0.9.3-dev-c74c628.0+c74c628",
29
29
  "@cosmjs/encoding": "^0.32.3",
30
30
  "@cosmjs/proto-signing": "^0.32.3",
31
31
  "@cosmjs/stargate": "^0.32.3",
@@ -38,7 +38,7 @@
38
38
  "node-fetch": "^2.6.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@agoric/cosmic-proto": "0.4.1-dev-4c9a859.0+4c9a859",
41
+ "@agoric/cosmic-proto": "0.4.1-dev-c74c628.0+c74c628",
42
42
  "@endo/ses-ava": "^1.2.1",
43
43
  "@types/node-fetch": "^2.6.2",
44
44
  "ava": "^5.3.0",
@@ -62,5 +62,5 @@
62
62
  "typeCoverage": {
63
63
  "atLeast": 89.6
64
64
  },
65
- "gitHead": "4c9a859bd5fe8ec5e5197b1fc820594b4969c126"
65
+ "gitHead": "c74c62863bb9de77e66f8d909058804912e72528"
66
66
  }
@@ -1,10 +1,17 @@
1
1
  // @ts-check
2
2
  /* global globalThis */
3
- import { QueryClient, setupBankExtension } from '@cosmjs/stargate';
4
- import { Tendermint34Client } from '@cosmjs/tendermint-rpc';
5
3
  import anyTest from 'ava';
4
+ import {
5
+ createProtobufRpcClient,
6
+ QueryClient,
7
+ setupBankExtension,
8
+ } from '@cosmjs/stargate';
9
+ import { Tendermint34Client } from '@cosmjs/tendermint-rpc';
10
+ import {
11
+ QueryChildrenRequest,
12
+ QueryChildrenResponse,
13
+ } from '@agoric/cosmic-proto/vstorage/query.js';
6
14
 
7
- import { agoric } from '@agoric/cosmic-proto';
8
15
  import { makeHttpClient } from '../src/makeHttpClient.js';
9
16
  import { captureIO, replayIO, web1, web2 } from './net-access-fixture.js';
10
17
 
@@ -69,6 +76,24 @@ const scenario2 = {
69
76
  ],
70
77
  };
71
78
 
79
+ // XXX open code until https://github.com/Agoric/agoric-sdk/issues/9200
80
+ class QueryClientImpl {
81
+ rpc;
82
+
83
+ service;
84
+
85
+ constructor(rpc, opts) {
86
+ this.service = opts?.service || 'agoric.vstorage.Query';
87
+ this.rpc = rpc;
88
+ }
89
+
90
+ Children(request) {
91
+ const reqData = QueryChildrenRequest.encode(request).finish();
92
+ const promise = this.rpc.request(this.service, 'Children', reqData);
93
+ return promise.then(respData => QueryChildrenResponse.decode(respData));
94
+ }
95
+ }
96
+
72
97
  test(`vstorage query: Children (RECORDING: ${RECORDING})`, async t => {
73
98
  const { context: io } = t;
74
99
 
@@ -77,13 +102,12 @@ test(`vstorage query: Children (RECORDING: ${RECORDING})`, async t => {
77
102
  : { fetch: replayIO(web2), web: new Map() };
78
103
  const rpcClient = makeHttpClient(scenario2.endpoint, fetchMock);
79
104
 
80
- t.is(agoric.vstorage.Children.typeUrl, '/agoric.vstorage.Children');
81
-
82
105
  const tmClient = await Tendermint34Client.create(rpcClient);
83
106
  const qClient = new QueryClient(tmClient);
84
- const queryService = agoric.vstorage.createRpcQueryExtension(qClient);
107
+ const rpc = createProtobufRpcClient(qClient);
108
+ const queryService = new QueryClientImpl(rpc);
85
109
 
86
- const children = await queryService.children({ path: '' });
110
+ const children = await queryService.Children({ path: '' });
87
111
  if (io.recording) {
88
112
  t.snapshot(web);
89
113
  }