@agoric/casting 0.4.3-other-dev-3eb1a1d.0 → 0.4.3-other-dev-fbe72e7.0.fbe72e7

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,54 +1,55 @@
1
1
  {
2
2
  "name": "@agoric/casting",
3
- "version": "0.4.3-other-dev-3eb1a1d.0+3eb1a1d",
3
+ "version": "0.4.3-other-dev-fbe72e7.0.fbe72e7",
4
4
  "description": "Agoric's OCap broadcasting system",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
7
7
  "repository": "https://github.com/Agoric/agoric-sdk",
8
8
  "scripts": {
9
9
  "build": "exit 0",
10
- "prepack": "tsc --build tsconfig.build.json",
11
- "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
10
+ "prepack": "yarn run -T tsc --build tsconfig.build.json",
11
+ "postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
12
12
  "demo": "node -e 'import(\"./test/fake-rpc-server.js\").then(ns => ns.develop())'",
13
13
  "test": "ava",
14
- "test:c8": "c8 --all $C8_OPTIONS ava",
14
+ "test:c8": "c8 --all ${C8_OPTIONS:-} ava",
15
15
  "test:xs": "exit 0",
16
16
  "lint-fix": "yarn lint:eslint --fix",
17
- "lint": "run-s --continue-on-error lint:*",
18
- "lint:types": "tsc",
19
- "lint:eslint": "eslint --ext .js,.ts ."
17
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
18
+ "lint:types": "yarn run -T tsc",
19
+ "lint:eslint": "yarn run -T eslint ."
20
20
  },
21
21
  "keywords": [],
22
22
  "author": "Agoric",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@agoric/internal": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
26
- "@agoric/notifier": "0.6.3-other-dev-3eb1a1d.0+3eb1a1d",
27
- "@agoric/store": "0.9.3-other-dev-3eb1a1d.0+3eb1a1d",
28
- "@cosmjs/encoding": "^0.32.3",
29
- "@cosmjs/proto-signing": "^0.32.3",
30
- "@cosmjs/stargate": "^0.32.3",
31
- "@cosmjs/tendermint-rpc": "^0.32.3",
32
- "@endo/errors": "^1.2.8",
33
- "@endo/far": "^1.1.9",
34
- "@endo/init": "^1.1.7",
35
- "@endo/lockdown": "^1.0.13",
36
- "@endo/marshal": "^1.6.2",
37
- "@endo/promise-kit": "^1.1.8"
25
+ "@agoric/internal": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
26
+ "@agoric/notifier": "0.6.3-other-dev-fbe72e7.0.fbe72e7",
27
+ "@agoric/store": "0.9.3-other-dev-fbe72e7.0.fbe72e7",
28
+ "@cosmjs/encoding": "^0.36.0",
29
+ "@cosmjs/proto-signing": "^0.36.0",
30
+ "@cosmjs/stargate": "^0.36.0",
31
+ "@cosmjs/tendermint-rpc": "^0.36.0",
32
+ "@endo/errors": "^1.2.13",
33
+ "@endo/far": "^1.1.14",
34
+ "@endo/init": "^1.1.12",
35
+ "@endo/lockdown": "^1.0.18",
36
+ "@endo/marshal": "^1.8.0",
37
+ "@endo/promise-kit": "^1.1.13"
38
38
  },
39
39
  "devDependencies": {
40
- "@agoric/cosmic-proto": "0.4.1-other-dev-3eb1a1d.0+3eb1a1d",
41
- "@endo/ses-ava": "^1.2.8",
40
+ "@agoric/cosmic-proto": "0.4.1-other-dev-fbe72e7.0.fbe72e7",
41
+ "@endo/ses-ava": "^1.3.2",
42
42
  "ava": "^5.3.0",
43
- "c8": "^10.1.2",
43
+ "c8": "^10.1.3",
44
44
  "express": "^5.0.1",
45
+ "tsd": "^0.33.0",
45
46
  "ws": "^7.2.0"
46
47
  },
47
48
  "publishConfig": {
48
49
  "access": "public"
49
50
  },
50
51
  "engines": {
51
- "node": "^18.12 || ^20.9"
52
+ "node": "^20.9 || ^22.11"
52
53
  },
53
54
  "ava": {
54
55
  "files": [
@@ -58,7 +59,7 @@
58
59
  "workerThreads": false
59
60
  },
60
61
  "typeCoverage": {
61
- "atLeast": 88.91
62
+ "atLeast": 89.19
62
63
  },
63
- "gitHead": "3eb1a1d2d75b2b4a94807cd3bf759bc9fc531f05"
64
+ "gitHead": "fbe72e72107f9997f788674e668c660d92ec4492"
64
65
  }
@@ -4,7 +4,7 @@ export function vstorageKeySpecToPath({ storeName, storeSubkey }: VStorageKey):
4
4
  * @param {string} [storeName]
5
5
  * @returns {import('./types.js').CastingSpec}
6
6
  */
7
- export function DEFAULT_PATH_CONVERTER(storagePath: string, storeName?: string | undefined): import("./types.js").CastingSpec;
7
+ export function DEFAULT_PATH_CONVERTER(storagePath: string, storeName?: string): import("./types.js").CastingSpec;
8
8
  /**
9
9
  * @type {Record<string, (path: string) => import('./types.js').CastingSpec>}
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"casting-spec.d.ts","sourceRoot":"","sources":["casting-spec.js"],"names":[],"mappings":"AA6CO,kEAHI,WAAW,GACT,MAAM,CAYlB;AAlCD;;;;GAIG;AACH,oDAJW,MAAM,mCAEJ,OAAO,YAAY,EAAE,WAAW,CAa5C;AAsBD;;GAEG;AACH,qCAFU,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,YAAY,EAAE,WAAW,CAAC,CAMzE;AAMI,sDAHI,MAAM,GACJ,OAAO,YAAY,EAAE,WAAW,CAc5C;AAQM,mDAHI,GAAG,GACD,OAAO,YAAY,EAAE,WAAW,CAmC5C;AAMM,gDAHI,IAAI,CAAC,GAAG,CAAC,GACP,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,CAKrD;AAQM,yCAHI,IAAI,CAAC,OAAO,CAAC,GACX,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,CAgBrD"}
1
+ {"version":3,"file":"casting-spec.d.ts","sourceRoot":"","sources":["casting-spec.js"],"names":[],"mappings":"AA6CO,kEAHI,WAAW,GACT,MAAM,CAYlB;AAlCD;;;;GAIG;AACH,oDAJW,MAAM,cACN,MAAM,GACJ,OAAO,YAAY,EAAE,WAAW,CAa5C;AAsBD;;GAEG;AACH,qCAFU,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,YAAY,EAAE,WAAW,CAAC,CAMzE;AAMI,sDAHI,MAAM,GACJ,OAAO,YAAY,EAAE,WAAW,CAc5C;AAQM,mDAHI,GAAG,GACD,OAAO,YAAY,EAAE,WAAW,CAmC5C;AAMM,gDAHI,IAAI,CAAC,GAAG,CAAC,GACP,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,CAKrD;AAQM,yCAHI,IAAI,CAAC,OAAO,CAAC,GACX,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,CAgBrD"}
package/src/defaults.d.ts CHANGED
@@ -5,11 +5,15 @@ export const DEFAULT_BOOTSTRAP: "http://localhost:26657";
5
5
  export const DEFAULT_JITTER_SECONDS: 5;
6
6
  export const DEFAULT_POLL_WITH_EVENTS_SECONDS: 600;
7
7
  export const DEFAULT_KEEP_POLLING_SECONDS: 5;
8
+ /**
9
+ * Default backoff is the block interval.
10
+ */
11
+ export const DEFAULT_MAX_BACKOFF: 6000;
8
12
  export function delay(ms: number): Promise<void>;
9
- export function randomBackoff(range: number, cap?: number | undefined): number;
10
- export function exponentialBackoff(attempt?: number | undefined, base?: number | undefined, cap?: number | undefined): number;
13
+ export function randomBackoff(range: number, cap?: number): number;
14
+ export function exponentialBackoff(attempt?: number, base?: number, cap?: number): number;
11
15
  export function DEFAULT_JITTER(where: string): Promise<void>;
12
- export function DEFAULT_RETRY_CALLBACK(where: string, err: any, attempt?: number | undefined): Promise<void>;
16
+ export function DEFAULT_RETRY_CALLBACK(where: string, err: any, attempt?: number): Promise<void>;
13
17
  export function DEFAULT_KEEP_POLLING(): Promise<boolean>;
14
18
  export function MAKE_DEFAULT_DECODER(): (str: any) => any;
15
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["defaults.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,yDAA0D;AAE1D,uCAAwC;AAExC,mDAAoD;AAEpD,6CAA8C;AAUvC,0BAHI,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAEgD;AAMnE,qCAHI,MAAM,oCAKhB;AAOM,8HAEN;AAQM,sCAHI,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAMzB;AAUM,8CALI,MAAM,OACN,GAAG,iCAED,OAAO,CAAC,IAAI,CAAC,CASzB;AAOM,wCAFM,OAAO,CAAC,OAAO,CAAC,CAGgD;AAEtE,0DAaN;AAED;;;;GAIG;AACH,wCAFU,MAAM,OAAO,YAAY,EAAE,YAAY,CA2B/C"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["defaults.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,gCAAiC,wBAAwB,CAAC;AAE1D,qCAAsC,CAAC,CAAC;AAExC,+CAAgD,GAAG,CAAC;AAEpD,2CAA4C,CAAC,CAAC;AAE9C;;GAEG;AACH,kCAAmC,IAAK,CAAC;AAUlC,0BAHI,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAEgD;AAMnE,qCAHI,MAAM,QACN,MAAM,UAIhB;AAOM,6CAJI,MAAM,SACN,MAAM,QACN,MAAM,UAQhB;AAQM,sCAHI,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAMzB;AAUM,8CALI,MAAM,OACN,GAAG,YACH,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CASzB;AAOM,wCAFM,OAAO,CAAC,OAAO,CAAC,CAGgD;AAEtE,0DAaN;AAED;;;;GAIG;AACH,wCAFU,MAAM,OAAO,YAAY,EAAE,YAAY,CA2B/C"}
package/src/defaults.js CHANGED
@@ -13,6 +13,11 @@ export const DEFAULT_POLL_WITH_EVENTS_SECONDS = 600;
13
13
 
14
14
  export const DEFAULT_KEEP_POLLING_SECONDS = 5;
15
15
 
16
+ /**
17
+ * Default backoff is the block interval.
18
+ */
19
+ export const DEFAULT_MAX_BACKOFF = 6_000;
20
+
16
21
  /**
17
22
  * Resolve a Promise after a given number of milliseconds.
18
23
  *
@@ -36,7 +41,11 @@ export const randomBackoff = (range, cap = range) => {
36
41
  * @param {number} [base]
37
42
  * @param {number} [cap]
38
43
  */
39
- export const exponentialBackoff = (attempt = 0, base = 1_000, cap = 30_000) => {
44
+ export const exponentialBackoff = (
45
+ attempt = 0,
46
+ base = 1_000,
47
+ cap = DEFAULT_MAX_BACKOFF,
48
+ ) => {
40
49
  return randomBackoff(2 ** attempt * base, cap);
41
50
  };
42
51
 
@@ -1,4 +1,4 @@
1
- export function makeCosmjsFollower<T>(sourceP: any, leaderOrMaker?: import("./types.js").LeaderOrMaker | undefined, options?: import("./types.js").FollowerOptions | undefined): ValueFollower<T>;
1
+ export function makeCosmjsFollower<T>(sourceP: any, leaderOrMaker?: import("./types.js").LeaderOrMaker, options?: import("./types.js").FollowerOptions): ValueFollower<T>;
2
2
  export type ValueFollower<T> = import("./types.js").Follower<import("./types.js").ValueFollowerElement<T>>;
3
3
  /**
4
4
  * The response of an ABCI query to Tendermint.
@@ -1 +1 @@
1
- {"version":3,"file":"follower-cosmjs.d.ts","sourceRoot":"","sources":["follower-cosmjs.js"],"names":[],"mappings":"AAwGO,mCANM,CAAC,WACH,GAAG,+HAGD,aAAa,CAAC,CAAC,CAAC,CAsf5B;0BAnkBa,CAAC,IAAW,OAAO,YAAY,EAAE,QAAQ,CAAC,OAAO,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;;;;;;iCAIxF;IACZ,QAAY,CAAC,KAAK,EAAE,UAAU,CAAC;IAC/B,QAAY,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
1
+ {"version":3,"file":"follower-cosmjs.d.ts","sourceRoot":"","sources":["follower-cosmjs.js"],"names":[],"mappings":"AA4GO,mCANM,CAAC,WACH,GAAG,kBACH,OAAO,YAAY,EAAE,aAAa,YAClC,OAAO,YAAY,EAAE,eAAe,GAClC,aAAa,CAAC,CAAC,CAAC,CA4f5B;0BA7kBa,CAAC,IAAW,OAAO,YAAY,EAAE,QAAQ,CAAC,OAAO,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;;;;;;iCAIxF;IACZ,QAAY,CAAC,KAAK,EAAE,UAAU,CAAC;IAC/B,QAAY,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
@@ -92,6 +92,10 @@ const collectSingle = values => {
92
92
  return head[0];
93
93
  };
94
94
 
95
+ // NB: 'none' is the only value that works. We've left the other cases
96
+ // in anticipation of the ecosystem providing JS proofs again.
97
+ // See https://github.com/cosmos/cosmjs/issues/1618#issuecomment-2574934505
98
+ // and https://github.com/cosmos/ics23/pull/353?email_source=slack
95
99
  // Coordinate with switch/case of tryGetDataAtHeight.
96
100
  const proofs = ['strict', 'none', 'optimistic'];
97
101
 
@@ -110,7 +114,7 @@ export const makeCosmjsFollower = (
110
114
  const {
111
115
  decode = MAKE_DEFAULT_DECODER(),
112
116
  unserializer = MAKE_DEFAULT_UNSERIALIZER(),
113
- proof = 'optimistic',
117
+ proof = 'none',
114
118
  crasher = null,
115
119
  } = options;
116
120
 
@@ -217,14 +221,20 @@ export const makeCosmjsFollower = (
217
221
  };
218
222
 
219
223
  /**
224
+ * @deprecated no longer supported https://github.com/cosmos/cosmjs/pull/1623
220
225
  * @param {number} [height]
221
226
  * @returns {Promise<QueryStoreResponse>}
222
227
  */
223
228
  const getProvenDataAtHeight = async height => {
224
- return retryGetPrefixedData(async (endpoint, storeName, storeSubkey) => {
225
- const queryClient = await provideQueryClient(endpoint);
226
- return E(queryClient).queryStoreVerified(storeName, storeSubkey, height);
227
- });
229
+ console.error(
230
+ 'getProvenDataAtHeight',
231
+ height,
232
+ 'is no longer supported; use',
233
+ { proof: 'none' },
234
+ );
235
+ throw makeError(
236
+ X`Verified queries are no longer supported; use { proof: 'none' }`,
237
+ );
228
238
  };
229
239
 
230
240
  /**
package/src/follower.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export function makeFollower<T>(specP: ERef<import("./types.js").CastingSpec> | string, leaderOrMaker?: import("./types.js").LeaderOrMaker | undefined, options?: import("./types.js").FollowerOptions | undefined): Promise<import("./follower-cosmjs.js").ValueFollower<T>>;
1
+ export function makeFollower<T>(specP: ERef<import("./types.js").CastingSpec> | string, leaderOrMaker?: import("./types.js").LeaderOrMaker, options?: import("./types.js").FollowerOptions): Promise<import("./follower-cosmjs.js").ValueFollower<T>>;
2
2
  //# sourceMappingURL=follower.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"follower.d.ts","sourceRoot":"","sources":["follower.js"],"names":[],"mappings":"AA4DO,6BANM,CAAC,SACH,IAAI,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,GAAG,MAAM,+HAG7C,OAAO,CAAC,OAAO,sBAAsB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CASpE"}
1
+ {"version":3,"file":"follower.d.ts","sourceRoot":"","sources":["follower.js"],"names":[],"mappings":"AA4DO,6BANM,CAAC,SACH,IAAI,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,GAAG,MAAM,kBAC/C,OAAO,YAAY,EAAE,aAAa,YAClC,OAAO,YAAY,EAAE,eAAe,GAClC,OAAO,CAAC,OAAO,sBAAsB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CASpE"}
package/src/iterable.d.ts CHANGED
@@ -6,14 +6,14 @@ export function iterateLatest<T>(follower: ERef<import("./types.js").Follower<T>
6
6
  /** @returns {AsyncIterator<T>} */
7
7
  [Symbol.asyncIterator]: () => AsyncIterator<T>;
8
8
  }>;
9
- export function iterateEach<T>(follower: ERef<import("./types.js").Follower<T>>, options?: import("./types.js").IterateEachOptions | undefined): {
9
+ export function iterateEach<T>(follower: ERef<import("./types.js").Follower<T>>, options?: import("./types.js").IterateEachOptions): {
10
10
  /** @returns {AsyncIterator<T>} */
11
11
  [Symbol.asyncIterator]: () => AsyncIterator<T>;
12
12
  } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
13
13
  /** @returns {AsyncIterator<T>} */
14
14
  [Symbol.asyncIterator]: () => AsyncIterator<T>;
15
15
  }>;
16
- export function iterateReverse<T>(follower: ERef<import("./types.js").Follower<T>>, options?: import("./types.js").IterateEachOptions | undefined): {
16
+ export function iterateReverse<T>(follower: ERef<import("./types.js").Follower<T>>, options?: import("./types.js").IterateEachOptions): {
17
17
  /** @returns {AsyncIterator<T>} */
18
18
  [Symbol.asyncIterator]: () => AsyncIterator<T>;
19
19
  } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -1 +1 @@
1
- {"version":3,"file":"iterable.d.ts","sourceRoot":"","sources":["iterable.js"],"names":[],"mappings":"AAWO,iCANM,GAAG,EACH,IAAI,YACN,aAAa,CAAC,GAAG,CAAC,aAClB,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAClB,aAAa,CAAC,IAAI,CAAC,CAU/B;AAQM,8BAHM,CAAC,YACH,IAAI,CAAC,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAK7C,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;;IAA9B,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;GAQ9B;AASG,4BAJM,CAAC,YACH,IAAI,CAAC,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAM7C,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;;IAA9B,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;GAQ9B;AAOG,+BAJM,CAAC,YACH,IAAI,CAAC,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAM7C,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;;IAA9B,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;GAQ9B"}
1
+ {"version":3,"file":"iterable.d.ts","sourceRoot":"","sources":["iterable.js"],"names":[],"mappings":"AAWO,iCANM,GAAG,EACH,IAAI,YACN,aAAa,CAAC,GAAG,CAAC,aAClB,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAClB,aAAa,CAAC,IAAI,CAAC,CAU/B;AAQM,8BAHM,CAAC,YACH,IAAI,CAAC,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAK7C,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;;IAA9B,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;GAQ9B;AASG,4BAJM,CAAC,YACH,IAAI,CAAC,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,YACtC,OAAO,YAAY,EAAE,kBAAkB;IAK9C,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;;IAA9B,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;GAQ9B;AAOG,+BAJM,CAAC,YACH,IAAI,CAAC,OAAO,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,YACtC,OAAO,YAAY,EAAE,kBAAkB;IAK9C,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;;IAA9B,kCAAkC;kCAApB,aAAa,CAAC,CAAC,CAAC;GAQ9B"}
@@ -1,4 +1,4 @@
1
- export function makeLeaderFromRpcAddresses(rpcAddrs: string[], leaderOptions?: import("./types.js").LeaderOptions | undefined): import("./types.js").Leader;
2
- export function makeLeaderFromNetworkConfig(netconfigURL: string, options?: import("./types.js").LeaderOptions | undefined): Promise<any>;
3
- export function makeLeader(bootstrap?: string | undefined, options?: import("./types.js").LeaderOptions | undefined): ERef<import("./types.js").Leader>;
1
+ export function makeLeaderFromRpcAddresses(rpcAddrs: string[], leaderOptions?: import("./types.js").LeaderOptions): import("./types.js").Leader;
2
+ export function makeLeaderFromNetworkConfig(netconfigURL: string, options?: import("./types.js").LeaderOptions): Promise<any>;
3
+ export function makeLeader(bootstrap?: string, options?: import("./types.js").LeaderOptions): ERef<import("./types.js").Leader>;
4
4
  //# sourceMappingURL=leader-netconfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"leader-netconfig.d.ts","sourceRoot":"","sources":["leader-netconfig.js"],"names":[],"mappings":"AAeO,qDAJI,MAAM,EAAE,mEAEN,OAAO,YAAY,EAAE,MAAM,CAevC;AAMM,0DAHI,MAAM,0EAoChB;AAOM,sHAFM,IAAI,CAAC,OAAO,YAAY,EAAE,MAAM,CAAC,CAO7C"}
1
+ {"version":3,"file":"leader-netconfig.d.ts","sourceRoot":"","sources":["leader-netconfig.js"],"names":[],"mappings":"AAeO,qDAJI,MAAM,EAAE,kBACR,OAAO,YAAY,EAAE,aAAa,GAChC,OAAO,YAAY,EAAE,MAAM,CAevC;AAMM,0DAHI,MAAM,YACN,OAAO,YAAY,EAAE,aAAa,gBAmC5C;AAOM,uCAJI,MAAM,YACN,OAAO,YAAY,EAAE,aAAa,GAChC,IAAI,CAAC,OAAO,YAAY,EAAE,MAAM,CAAC,CAO7C"}
package/src/types.d.ts CHANGED
@@ -42,9 +42,9 @@ export type FollowerOptions = {
42
42
  };
43
43
  export type CastingSpec = {
44
44
  storeName?: string | undefined;
45
- storeSubkey?: Uint8Array | undefined;
46
- dataPrefixBytes?: Uint8Array | undefined;
47
- noDataValue?: Uint8Array | undefined;
45
+ storeSubkey?: Uint8Array<ArrayBufferLike> | undefined;
46
+ dataPrefixBytes?: Uint8Array<ArrayBufferLike> | undefined;
47
+ noDataValue?: Uint8Array<ArrayBufferLike> | undefined;
48
48
  subscription?: globalThis.ERef<Subscription<any>> | undefined;
49
49
  notifier?: globalThis.ERef<Notifier<any>> | undefined;
50
50
  };
@@ -15,7 +15,11 @@ import {
15
15
  import { makeTendermintRpcClient } from '../src/makeHttpClient.js';
16
16
  import { captureIO, replayIO, web1, web2 } from './net-access-fixture.js';
17
17
 
18
- /** @type {import('ava').TestFn<Awaited<ReturnType<typeof makeTestContext>>>} */
18
+ /**
19
+ * @import {EReturn} from '@endo/far';
20
+ */
21
+
22
+ /** @type {import('ava').TestFn<EReturn<typeof makeTestContext>>} */
19
23
  const test = /** @type {any} */ (anyTest);
20
24
 
21
25
  const RECORDING = false;
@@ -0,0 +1,31 @@
1
+ import { E } from '@endo/far';
2
+ import { expectType } from 'tsd';
3
+ import type { ValueFollower } from '../src/follower-cosmjs.js';
4
+ import { makeFollower } from '../src/follower.js';
5
+ import { iterateLatest } from '../src/iterable.js';
6
+ import { makeLeader } from '../src/leader-netconfig.js';
7
+ import type { ValueFollowerElement } from '../src/types.js';
8
+
9
+ type ThePublishedDatum = { a: 1; b: 'two' };
10
+ type TheFollowerElement = ValueFollowerElement<ThePublishedDatum>;
11
+
12
+ const leader = makeLeader();
13
+
14
+ {
15
+ const f = makeFollower<ThePublishedDatum>('', leader, {});
16
+ expectType<ValueFollower<ThePublishedDatum>>(await f);
17
+
18
+ expectType<AsyncIterable<TheFollowerElement>>(await E(f).getLatestIterable());
19
+
20
+ expectType<AsyncIterable<TheFollowerElement>>(await E(f).getLatestIterable());
21
+
22
+ expectType<AsyncIterable<TheFollowerElement>>(
23
+ await E(f).getReverseIterable(),
24
+ );
25
+
26
+ const iter = iterateLatest(f);
27
+ for await (const { value } of iter) {
28
+ assert(value, 'value undefined');
29
+ expectType<ThePublishedDatum>(value);
30
+ }
31
+ }
@@ -1 +1 @@
1
- {"root":["./src/casting-spec.js","./src/change-follower.js","./src/defaults.js","./src/follower-cosmjs.js","./src/follower.js","./src/iterable.js","./src/leader-netconfig.js","./src/leader.js","./src/main.js","./src/makeHttpClient.js","./src/netconfig.js","./src/shuffle.js","./src/types.js"],"version":"5.6.3"}
1
+ {"root":["./src/casting-spec.js","./src/change-follower.js","./src/defaults.js","./src/follower-cosmjs.js","./src/follower.js","./src/iterable.js","./src/leader-netconfig.js","./src/leader.js","./src/main.js","./src/makeHttpClient.js","./src/netconfig.js","./src/shuffle.js","./src/types.js"],"version":"5.9.2"}
package/tsconfig.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "include": [
6
6
  "*.js",
7
7
  "public/**/*.js",
8
- "src/**/*.js",
9
- "test/**/*.js",
8
+ "src",
9
+ "test",
10
10
  ],
11
11
  }