@agoric/casting 0.3.5-pismo-dev-0d5327f.0 → 0.4.1-dev-bf4b59f.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/CHANGELOG.md +34 -0
- package/README.md +1 -1
- package/jsconfig.build.json +12 -0
- package/jsconfig.json +1 -15
- package/node-fetch-shim.d.ts +2 -0
- package/node-fetch-shim.d.ts.map +1 -0
- package/node-fetch-shim.js +3 -0
- package/package.json +22 -17
- package/src/casting-spec.d.ts +16 -0
- package/src/casting-spec.d.ts.map +1 -0
- package/src/casting-spec.js +39 -6
- package/src/change-follower.d.ts +2 -0
- package/src/change-follower.d.ts.map +1 -0
- package/src/change-follower.js +0 -1
- package/src/defaults.d.ts +21 -0
- package/src/defaults.d.ts.map +1 -0
- package/src/defaults.js +8 -3
- package/src/follower-cosmjs.d.ts +12 -0
- package/src/follower-cosmjs.d.ts.map +1 -0
- package/src/follower-cosmjs.js +114 -143
- package/src/follower.d.ts +2 -0
- package/src/follower.d.ts.map +1 -0
- package/src/follower.js +7 -7
- package/src/iterable.d.ts +24 -0
- package/src/iterable.d.ts.map +1 -0
- package/src/iterable.js +3 -45
- package/src/leader-netconfig.d.ts +4 -0
- package/src/leader-netconfig.d.ts.map +1 -0
- package/src/leader-netconfig.js +7 -6
- package/src/leader.d.ts +2 -0
- package/src/leader.d.ts.map +1 -0
- package/src/leader.js +0 -1
- package/src/main.d.ts +9 -0
- package/src/main.d.ts.map +1 -0
- package/src/main.js +2 -0
- package/src/netconfig.d.ts +47 -0
- package/src/netconfig.d.ts.map +1 -0
- package/src/netconfig.js +40 -0
- package/src/shuffle.d.ts +2 -0
- package/src/shuffle.d.ts.map +1 -0
- package/src/shuffle.js +0 -2
- package/src/types.d.ts +54 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +3 -3
- package/test/deploy.js +1 -2
- package/test/fake-rpc-server.js +6 -3
- package/test/test-mvp.js +1 -1
- package/test/test-netconfig.js +48 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.4.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/casting@0.3.2...@agoric/casting@0.4.0) (2023-05-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* emit smallcaps-format data in all marshallers
|
|
12
|
+
* **AMM:** remove the AMM and cleanup bootstrap etc. dependencies (#7074)
|
|
13
|
+
* rename 'fit' to 'mustMatch'
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **internal:** makeFakeStorageKit supports "get" and "entries" ([6a69aab](https://github.com/Agoric/agoric-sdk/commit/6a69aab5cb54faae5af631bbc2281e4fc4ede8e0))
|
|
18
|
+
* emit smallcaps-format data in all marshallers ([1753df8](https://github.com/Agoric/agoric-sdk/commit/1753df83465785b5ee71b250770c9b012d750ffc)), closes [#6822](https://github.com/Agoric/agoric-sdk/issues/6822)
|
|
19
|
+
* **AMM:** remove the AMM and cleanup bootstrap etc. dependencies ([#7074](https://github.com/Agoric/agoric-sdk/issues/7074)) ([ed5ee58](https://github.com/Agoric/agoric-sdk/commit/ed5ee58a276fce3c55f19e4f6f662ed579896c2c)), closes [#7047](https://github.com/Agoric/agoric-sdk/issues/7047)
|
|
20
|
+
* **casting:** handle noData value encoding ([530bc41](https://github.com/Agoric/agoric-sdk/commit/530bc41854cc7f5e5749e97e87fabc6163a17864))
|
|
21
|
+
* assertNetworkConfig ([9762b19](https://github.com/Agoric/agoric-sdk/commit/9762b19b25ebcb4678faa389d39c4bab91e0c25c))
|
|
22
|
+
* getEachIterable skip height fetch ([77b1bb5](https://github.com/Agoric/agoric-sdk/commit/77b1bb589e90462bc7514347b8c62c236d72922e))
|
|
23
|
+
* getLatestIterable skip height fetch ([aff3354](https://github.com/Agoric/agoric-sdk/commit/aff335417d9553182d50a5b84a4aa7c7fb6ae430))
|
|
24
|
+
* getReverseIterable skip height fetch ([edbc8ec](https://github.com/Agoric/agoric-sdk/commit/edbc8ec2fab4a71e2675f5cc608f25d27b43b524))
|
|
25
|
+
* vstorageKeySpecToPath ([9db1fbb](https://github.com/Agoric/agoric-sdk/commit/9db1fbb1328c28282db972b3e130e2ee3515b87d))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **casting:** use new subscriber tools ([cb1f739](https://github.com/Agoric/agoric-sdk/commit/cb1f739c36c28befa2ab097bfc9b86686dbe57c3))
|
|
31
|
+
* require chainName ([5c5e661](https://github.com/Agoric/agoric-sdk/commit/5c5e661f444add3e1544c931c475a3a266a080de))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Miscellaneous Chores
|
|
35
|
+
|
|
36
|
+
* rename 'fit' to 'mustMatch' ([9fa3232](https://github.com/Agoric/agoric-sdk/commit/9fa32324f84bfb85de9e99e0c9ad277b8017b50e)), closes [#6844](https://github.com/Agoric/agoric-sdk/issues/6844)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
6
40
|
### [0.3.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/casting@0.3.3...@agoric/casting@0.3.4) (2023-02-17)
|
|
7
41
|
|
|
8
42
|
**Note:** Version bump only for package @agoric/casting
|
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ The `followerOpts` argument in `makeFollower(leader, key, followerOpts)` provide
|
|
|
44
44
|
- the `unserializer` option can be
|
|
45
45
|
- (default) - release unserialized objects using `@agoric/marshal`'s `makeMarshal()`
|
|
46
46
|
- `null` - don't additionally unserialize data before releasing it
|
|
47
|
-
- any unserializer object supporting `E(unserializer).
|
|
47
|
+
- any unserializer object supporting `E(unserializer).fromCapData(data)`
|
|
48
48
|
- the `crasher` option can be
|
|
49
49
|
- `null` (default) follower failures only propagate an exception/rejection
|
|
50
50
|
- any crasher object supporting `E(crasher).crash(reason)`
|
package/jsconfig.json
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
// This file can contain .js-specific Typescript compiler config.
|
|
2
2
|
{
|
|
3
|
-
"
|
|
4
|
-
"target": "esnext",
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
|
|
7
|
-
"noEmit": true,
|
|
8
|
-
/*
|
|
9
|
-
// The following flags are for creating .d.ts files:
|
|
10
|
-
"noEmit": false,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"emitDeclarationOnly": true,
|
|
13
|
-
*/
|
|
14
|
-
"downlevelIteration": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
"moduleResolution": "node",
|
|
17
|
-
},
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
18
4
|
"include": [
|
|
19
5
|
"*.js",
|
|
20
6
|
"public/**/*.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-fetch-shim.d.ts","sourceRoot":"","sources":["node-fetch-shim.js"],"names":[],"mappings":""}
|
package/node-fetch-shim.js
CHANGED
package/package.json
CHANGED
|
@@ -1,42 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/casting",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1-dev-bf4b59f.0+bf4b59f",
|
|
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 jsconfig.build.json",
|
|
11
|
+
"postpack": "git clean -f '*.d.ts*'",
|
|
10
12
|
"demo": "node -e 'import(\"./test/fake-rpc-server.js\").then(ns => ns.develop())'",
|
|
11
13
|
"test": "ava",
|
|
12
14
|
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
|
|
13
15
|
"test:xs": "exit 0",
|
|
14
16
|
"lint-fix": "yarn lint:eslint --fix",
|
|
15
17
|
"lint": "run-s --continue-on-error lint:*",
|
|
16
|
-
"lint:types": "tsc
|
|
18
|
+
"lint:types": "tsc -p jsconfig.json",
|
|
17
19
|
"lint:eslint": "eslint --ext .js,.ts ."
|
|
18
20
|
},
|
|
19
21
|
"keywords": [],
|
|
20
22
|
"author": "Agoric",
|
|
21
23
|
"license": "Apache-2.0",
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@agoric/
|
|
24
|
-
"@agoric/
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@cosmjs/
|
|
28
|
-
"@cosmjs/
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@endo/
|
|
32
|
-
"@endo/
|
|
33
|
-
"@endo/
|
|
25
|
+
"@agoric/internal": "0.3.1-dev-bf4b59f.0+bf4b59f",
|
|
26
|
+
"@agoric/notifier": "0.6.1-dev-bf4b59f.0+bf4b59f",
|
|
27
|
+
"@agoric/spawner": "0.6.7-dev-bf4b59f.0+bf4b59f",
|
|
28
|
+
"@agoric/store": "0.9.1-dev-bf4b59f.0+bf4b59f",
|
|
29
|
+
"@cosmjs/encoding": "^0.30.1",
|
|
30
|
+
"@cosmjs/proto-signing": "^0.30.1",
|
|
31
|
+
"@cosmjs/stargate": "^0.30.1",
|
|
32
|
+
"@cosmjs/tendermint-rpc": "^0.30.1",
|
|
33
|
+
"@endo/far": "^0.2.18",
|
|
34
|
+
"@endo/init": "^0.5.56",
|
|
35
|
+
"@endo/lockdown": "^0.1.28",
|
|
36
|
+
"@endo/marshal": "^0.8.5",
|
|
37
|
+
"@endo/promise-kit": "^0.2.56",
|
|
34
38
|
"node-fetch": "^2.6.0"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@endo/ses-ava": "^0.2.
|
|
38
|
-
"
|
|
39
|
-
"
|
|
41
|
+
"@endo/ses-ava": "^0.2.40",
|
|
42
|
+
"@types/node-fetch": "^2.6.2",
|
|
43
|
+
"ava": "^5.2.0",
|
|
44
|
+
"c8": "^7.13.0",
|
|
40
45
|
"express": "^4.17.1",
|
|
41
46
|
"ws": "^7.2.0"
|
|
42
47
|
},
|
|
@@ -53,5 +58,5 @@
|
|
|
53
58
|
"timeout": "20m",
|
|
54
59
|
"workerThreads": false
|
|
55
60
|
},
|
|
56
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "bf4b59f2128aca73d786429c6ef4a7c9cdfb6700"
|
|
57
62
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function vstorageKeySpecToPath({ storeName, storeSubkey }: VStorageKey): string;
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} storagePath
|
|
4
|
+
* @param {string} [storeName]
|
|
5
|
+
* @returns {import('./types').CastingSpec}
|
|
6
|
+
*/
|
|
7
|
+
export function DEFAULT_PATH_CONVERTER(storagePath: string, storeName?: string | undefined): import('./types').CastingSpec;
|
|
8
|
+
/**
|
|
9
|
+
* @type {Record<string, (path: string) => import('./types').CastingSpec>}
|
|
10
|
+
*/
|
|
11
|
+
export const pathPrefixToConverters: Record<string, (path: string) => import('./types').CastingSpec>;
|
|
12
|
+
export function makeCastingSpecFromString(specString: string): import('./types').CastingSpec;
|
|
13
|
+
export function makeCastingSpecFromObject(specObj: any): import('./types').CastingSpec;
|
|
14
|
+
export function makeCastingSpecFromRef(specCap: ERef<any>): Promise<import('./types').CastingSpec>;
|
|
15
|
+
export function makeCastingSpec(sourceP: ERef<unknown>): Promise<import('./types').CastingSpec>;
|
|
16
|
+
//# sourceMappingURL=casting-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"casting-spec.d.ts","sourceRoot":"","sources":["casting-spec.js"],"names":[],"mappings":"AA+CO,kEAHI,WAAW,GACT,MAAM,CAYlB;AAlCD;;;;GAIG;AACH,oDAJW,MAAM,mCAEJ,OAAO,SAAS,EAAE,WAAW,CAazC;AAsBD;;GAEG;AACH,2DAFgC,MAAM,KAAK,OAAO,SAAS,EAAE,WAAW,EAMrE;AAMI,sDAHI,MAAM,GACJ,OAAO,SAAS,EAAE,WAAW,CAczC;AAQM,mDAHI,GAAG,GACD,OAAO,SAAS,EAAE,WAAW,CAmCzC;AAMM,gDAHI,KAAK,GAAG,CAAC,GACP,QAAQ,OAAO,SAAS,EAAE,WAAW,CAAC,CAKlD;AAQM,yCAHI,KAAK,OAAO,CAAC,GACX,QAAQ,OAAO,SAAS,EAAE,WAAW,CAAC,CAgBlD"}
|
package/src/casting-spec.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
import * as encodingStar from '@cosmjs/encoding';
|
|
3
2
|
import { E, getInterfaceOf } from '@endo/far';
|
|
4
3
|
|
|
@@ -16,8 +15,11 @@ const swingsetPathToCastingSpec = storagePath =>
|
|
|
16
15
|
storeSubkey: toAscii(`swingset/data:${storagePath}`),
|
|
17
16
|
});
|
|
18
17
|
|
|
18
|
+
// See details of encoding in golang/cosmos/x/vstorage/types/path_keys.go
|
|
19
|
+
const KEY_SEPARATOR_BYTE = 0;
|
|
19
20
|
const PATH_SEPARATOR_BYTE = '.'.charCodeAt(0);
|
|
20
21
|
const DATA_PREFIX_BYTES = new Uint8Array([0]);
|
|
22
|
+
const NO_DATA_VALUE = new Uint8Array([255]);
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* @param {string} storagePath
|
|
@@ -29,11 +31,32 @@ const vstoragePathToCastingSpec = (storagePath, storeName = 'vstorage') => {
|
|
|
29
31
|
const buf = toAscii(`${elems.length}.${storagePath}`);
|
|
30
32
|
return harden({
|
|
31
33
|
storeName,
|
|
32
|
-
storeSubkey: buf.map(b =>
|
|
34
|
+
storeSubkey: buf.map(b =>
|
|
35
|
+
b === PATH_SEPARATOR_BYTE ? KEY_SEPARATOR_BYTE : b,
|
|
36
|
+
),
|
|
33
37
|
dataPrefixBytes: DATA_PREFIX_BYTES,
|
|
38
|
+
noDataValue: NO_DATA_VALUE,
|
|
34
39
|
});
|
|
35
40
|
};
|
|
36
41
|
|
|
42
|
+
// TODO make a similar castingSpecToPath.
|
|
43
|
+
// This one uses VStorageKey which has storeSubkey:string, not UInt8Array
|
|
44
|
+
/**
|
|
45
|
+
* @param {VStorageKey} vstorageKey
|
|
46
|
+
* @returns {string}
|
|
47
|
+
*/
|
|
48
|
+
export const vstorageKeySpecToPath = ({ storeName, storeSubkey }) => {
|
|
49
|
+
assert.equal(storeName, 'vstorage');
|
|
50
|
+
const firstSeperator = storeSubkey.indexOf(
|
|
51
|
+
String.fromCharCode(KEY_SEPARATOR_BYTE),
|
|
52
|
+
);
|
|
53
|
+
const published = storeSubkey.slice(firstSeperator);
|
|
54
|
+
const elements = published.split(String.fromCharCode(KEY_SEPARATOR_BYTE));
|
|
55
|
+
// drop the empty
|
|
56
|
+
elements.shift();
|
|
57
|
+
return `vstorage:${elements.join('.')}`;
|
|
58
|
+
};
|
|
59
|
+
|
|
37
60
|
export const DEFAULT_PATH_CONVERTER = vstoragePathToCastingSpec;
|
|
38
61
|
|
|
39
62
|
/**
|
|
@@ -41,7 +64,7 @@ export const DEFAULT_PATH_CONVERTER = vstoragePathToCastingSpec;
|
|
|
41
64
|
*/
|
|
42
65
|
export const pathPrefixToConverters = harden({
|
|
43
66
|
'swingset:': swingsetPathToCastingSpec,
|
|
44
|
-
'
|
|
67
|
+
'vstorage:': vstoragePathToCastingSpec,
|
|
45
68
|
':': DEFAULT_PATH_CONVERTER,
|
|
46
69
|
});
|
|
47
70
|
|
|
@@ -70,8 +93,14 @@ const te = new TextEncoder();
|
|
|
70
93
|
* @returns {import('./types').CastingSpec}
|
|
71
94
|
*/
|
|
72
95
|
export const makeCastingSpecFromObject = specObj => {
|
|
73
|
-
const {
|
|
74
|
-
|
|
96
|
+
const {
|
|
97
|
+
storeName,
|
|
98
|
+
storeSubkey,
|
|
99
|
+
dataPrefixBytes,
|
|
100
|
+
noDataValue,
|
|
101
|
+
subscription,
|
|
102
|
+
notifier,
|
|
103
|
+
} = specObj;
|
|
75
104
|
if (subscription || notifier) {
|
|
76
105
|
return harden({
|
|
77
106
|
subscription,
|
|
@@ -86,10 +115,15 @@ export const makeCastingSpecFromObject = specObj => {
|
|
|
86
115
|
if (typeof dataPrefixBytes === 'string') {
|
|
87
116
|
dataPrefix = te.encode(dataPrefixBytes);
|
|
88
117
|
}
|
|
118
|
+
let noData = noDataValue;
|
|
119
|
+
if (typeof noDataValue === 'string') {
|
|
120
|
+
noData = te.encode(noDataValue);
|
|
121
|
+
}
|
|
89
122
|
return harden({
|
|
90
123
|
storeName,
|
|
91
124
|
storeSubkey: subkey,
|
|
92
125
|
dataPrefixBytes: dataPrefix,
|
|
126
|
+
noDataValue: noData,
|
|
93
127
|
});
|
|
94
128
|
};
|
|
95
129
|
|
|
@@ -123,4 +157,3 @@ export const makeCastingSpec = async sourceP => {
|
|
|
123
157
|
}
|
|
124
158
|
assert.fail(`CastingSpec ${spec} is not a string, object, or ref`);
|
|
125
159
|
};
|
|
126
|
-
/** @typedef {ReturnType<typeof makeCastingSpec>} CastingSpec */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-follower.d.ts","sourceRoot":"","sources":["change-follower.js"],"names":[],"mappings":"AASO,kDAHI,OAAO,SAAS,EAAE,MAAM,GACtB,QAAQ,OAAO,YAAY,EAAE,QAAQ,CAAC,OAAO,SAAS,EAAE,aAAa,CAAC,CAAC,CA6CnF"}
|
package/src/change-follower.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default to the local chain.
|
|
3
|
+
*/
|
|
4
|
+
export const DEFAULT_BOOTSTRAP: "http://localhost:26657";
|
|
5
|
+
export const DEFAULT_JITTER_SECONDS: 5;
|
|
6
|
+
export const DEFAULT_POLL_WITH_EVENTS_SECONDS: 600;
|
|
7
|
+
export const DEFAULT_KEEP_POLLING_SECONDS: 5;
|
|
8
|
+
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;
|
|
11
|
+
export function DEFAULT_JITTER(where: string): Promise<void>;
|
|
12
|
+
export function DEFAULT_RETRY_CALLBACK(where: string, err: any, attempt?: number | undefined): Promise<void>;
|
|
13
|
+
export function DEFAULT_KEEP_POLLING(): Promise<boolean>;
|
|
14
|
+
export function MAKE_DEFAULT_DECODER(): (str: any) => any;
|
|
15
|
+
/**
|
|
16
|
+
* Unserialize the JSONable data.
|
|
17
|
+
*
|
|
18
|
+
* @type {() => import('./types').Unserializer}
|
|
19
|
+
*/
|
|
20
|
+
export const MAKE_DEFAULT_UNSERIALIZER: () => import('./types').Unserializer;
|
|
21
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +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,QAAQ,IAAI,CAAC,CAEgD;AAMnE,qCAHI,MAAM,oCAKhB;AAOM,8HAEN;AAQM,sCAHI,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMzB;AAUM,8CALI,MAAM,OACN,GAAG,iCAED,QAAQ,IAAI,CAAC,CASzB;AAOM,wCAFM,QAAQ,OAAO,CAAC,CAGgD;AAEtE,0DAaN;AAED;;;;GAIG;AACH,wCAFU,MAAM,OAAO,SAAS,EAAE,YAAY,CA2B5C"}
|
package/src/defaults.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
/* global setTimeout */
|
|
3
2
|
import { Far } from '@endo/far';
|
|
4
3
|
import { makeMarshal } from '@endo/marshal';
|
|
@@ -88,7 +87,7 @@ export const MAKE_DEFAULT_DECODER = () => {
|
|
|
88
87
|
try {
|
|
89
88
|
return harden(JSON.parse(str));
|
|
90
89
|
} catch (error) {
|
|
91
|
-
throw
|
|
90
|
+
throw Error(`Cannot decode alleged JSON (${error.message}): ${str}`);
|
|
92
91
|
}
|
|
93
92
|
});
|
|
94
93
|
};
|
|
@@ -115,6 +114,12 @@ export const MAKE_DEFAULT_UNSERIALIZER = () => {
|
|
|
115
114
|
return obj;
|
|
116
115
|
};
|
|
117
116
|
return Far('marshal unserializer', {
|
|
118
|
-
|
|
117
|
+
fromCapData: makeMarshal(undefined, slotToVal, {
|
|
118
|
+
serializeBodyFormat: 'smallcaps',
|
|
119
|
+
}).fromCapData,
|
|
120
|
+
/** @deprecated use fromCapData */
|
|
121
|
+
unserialize: makeMarshal(undefined, slotToVal, {
|
|
122
|
+
serializeBodyFormat: 'smallcaps',
|
|
123
|
+
}).fromCapData,
|
|
119
124
|
});
|
|
120
125
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function makeCosmjsFollower<T>(sourceP: any, leaderOrMaker?: import("./types.js").LeaderOrMaker | undefined, options?: import("./types.js").FollowerOptions | undefined): ValueFollower<T>;
|
|
2
|
+
export type ValueFollower<T> = import('./types.js').Follower<import('./types.js').ValueFollowerElement<T>>;
|
|
3
|
+
/**
|
|
4
|
+
* The response of an ABCI query to Tendermint.
|
|
5
|
+
* This is a subset of `tendermint34.AbciQueryResponse` in order
|
|
6
|
+
* to abstract away Tendermint versions.
|
|
7
|
+
*/
|
|
8
|
+
export type QueryStoreResponse = {
|
|
9
|
+
readonly value: Uint8Array;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=follower-cosmjs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"follower-cosmjs.d.ts","sourceRoot":"","sources":["follower-cosmjs.js"],"names":[],"mappings":"AAiGO,+CALI,GAAG,gJAyeb;+BAnjByB,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"}
|