@agoric/internal 0.4.0-u17.1 → 0.4.0-u18.1
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/README.md +4 -4
- package/package.json +17 -16
- package/src/action-types.d.ts +49 -5
- package/src/action-types.d.ts.map +1 -1
- package/src/action-types.js +72 -14
- package/src/batched-deliver.d.ts.map +1 -1
- package/src/callback.d.ts +1 -1
- package/src/callback.d.ts.map +1 -1
- package/src/chain-storage-paths.d.ts.map +1 -1
- package/src/chain-utils.d.ts +25 -0
- package/src/chain-utils.d.ts.map +1 -0
- package/src/chain-utils.js +57 -0
- package/src/config.d.ts +4 -1
- package/src/config.d.ts.map +1 -1
- package/src/config.js +2 -1
- package/src/errors.d.ts +1 -1
- package/src/errors.d.ts.map +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +4 -2
- package/src/js-utils.d.ts +7 -0
- package/src/js-utils.d.ts.map +1 -0
- package/src/js-utils.js +89 -0
- package/src/lib-chainStorage.d.ts +1 -23
- package/src/lib-chainStorage.d.ts.map +1 -1
- package/src/lib-chainStorage.js +5 -2
- package/src/lib-nodejs/engine-gc.d.ts +1 -1
- package/src/lib-nodejs/worker-protocol.js +1 -1
- package/src/marshal.d.ts +8 -2
- package/src/marshal.d.ts.map +1 -1
- package/src/marshal.js +7 -0
- package/src/netstring.d.ts +2 -2
- package/src/netstring.d.ts.map +1 -1
- package/src/netstring.js +2 -1
- package/src/node/buffer-line-transform.d.ts +3 -3
- package/src/node/buffer-line-transform.d.ts.map +1 -1
- package/src/node/buffer-line-transform.js +1 -1
- package/src/node/createBundles.js +1 -1
- package/src/node/fs-stream.d.ts +1 -1
- package/src/node/fs-stream.d.ts.map +1 -1
- package/src/node/fs-stream.js +42 -29
- package/src/node/shutdown.d.ts.map +1 -1
- package/src/node/shutdown.js +0 -1
- package/src/{utils.d.ts → ses-utils.d.ts} +1 -7
- package/src/ses-utils.d.ts.map +1 -0
- package/src/{utils.js → ses-utils.js} +8 -72
- package/src/storage-test-utils.d.ts +14 -4
- package/src/storage-test-utils.d.ts.map +1 -1
- package/src/storage-test-utils.js +128 -79
- package/src/tokens.d.ts.map +1 -1
- package/src/types-index.d.ts +1 -0
- package/src/types.d.ts +25 -59
- package/src/types.d.ts.map +1 -0
- package/src/types.ts +108 -0
- package/src/upgrade-api.d.ts +1 -0
- package/src/upgrade-api.d.ts.map +1 -1
- package/src/upgrade-api.js +25 -1
- package/src/utils.d.ts.map +0 -1
- /package/src/{types.js → types-index.js} +0 -0
package/README.md
CHANGED
|
@@ -10,11 +10,11 @@ Like all `@agoric` packages it follows Semantic Versioning. Unlike the others, i
|
|
|
10
10
|
|
|
11
11
|
# Design
|
|
12
12
|
|
|
13
|
-
It is meant to be a home for modules that have no
|
|
13
|
+
It is meant to be a home for modules that have no dependencies on other packages in this repository, except for the following packages that do not theirselves depend upon any other @agoric packages and may be destined for migration elsewhere:
|
|
14
14
|
|
|
15
|
-
- base-zone
|
|
16
|
-
- store
|
|
17
|
-
-
|
|
15
|
+
- [base-zone](../base-zone)
|
|
16
|
+
- [store](../store)
|
|
17
|
+
- [cosmic-proto](../cosmic-proto)
|
|
18
18
|
|
|
19
19
|
This package may not take dependencies on any others in this repository.
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/internal",
|
|
3
|
-
"version": "0.4.0-
|
|
3
|
+
"version": "0.4.0-u18.1",
|
|
4
4
|
"description": "Externally unsupported utilities internal to agoric-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "exit 0",
|
|
12
12
|
"prepack": "tsc --build tsconfig.build.json",
|
|
13
|
-
"postpack": "git clean -f '*.d.ts*'",
|
|
13
|
+
"postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
|
|
14
14
|
"test": "ava",
|
|
15
15
|
"test:nyc": "exit 0",
|
|
16
16
|
"test:xs": "exit 0",
|
|
@@ -20,22 +20,23 @@
|
|
|
20
20
|
"lint:types": "tsc"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agoric/base-zone": "^0.1.1-
|
|
24
|
-
"@endo/common": "^1.2.
|
|
25
|
-
"@endo/errors": "^1.2.
|
|
26
|
-
"@endo/far": "^1.1.
|
|
27
|
-
"@endo/init": "^1.1.
|
|
28
|
-
"@endo/marshal": "^1.
|
|
29
|
-
"@endo/pass-style": "^1.4.
|
|
30
|
-
"@endo/patterns": "^1.4.
|
|
31
|
-
"@endo/promise-kit": "^1.1.
|
|
32
|
-
"@endo/stream": "^1.2.
|
|
23
|
+
"@agoric/base-zone": "^0.1.1-u18.1",
|
|
24
|
+
"@endo/common": "^1.2.8",
|
|
25
|
+
"@endo/errors": "^1.2.8",
|
|
26
|
+
"@endo/far": "^1.1.9",
|
|
27
|
+
"@endo/init": "^1.1.7",
|
|
28
|
+
"@endo/marshal": "^1.6.2",
|
|
29
|
+
"@endo/pass-style": "^1.4.7",
|
|
30
|
+
"@endo/patterns": "^1.4.7",
|
|
31
|
+
"@endo/promise-kit": "^1.1.8",
|
|
32
|
+
"@endo/stream": "^1.2.8",
|
|
33
33
|
"anylogger": "^0.21.0",
|
|
34
34
|
"jessie.js": "^0.3.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@endo/
|
|
37
|
+
"@agoric/cosmic-proto": "^0.5.0-u18.5",
|
|
38
|
+
"@endo/exo": "^1.5.7",
|
|
39
|
+
"@endo/init": "^1.1.7",
|
|
39
40
|
"ava": "^5.3.0",
|
|
40
41
|
"tsd": "^0.31.1"
|
|
41
42
|
},
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"access": "public"
|
|
58
59
|
},
|
|
59
60
|
"typeCoverage": {
|
|
60
|
-
"atLeast": 93.
|
|
61
|
+
"atLeast": 93.06
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "f8c45b8a2e29a51522a81a6692af25b2d7f6b50f"
|
|
63
64
|
}
|
package/src/action-types.d.ts
CHANGED
|
@@ -1,17 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of messages used for communication between a cosmos-sdk blockchain node
|
|
3
|
+
* and its paired swingset VM, especially for the ABCI lifecycle. See:
|
|
4
|
+
*
|
|
5
|
+
* - https://github.com/tendermint/tendermint/blob/v0.34.x/spec/abci/abci.md#block-execution
|
|
6
|
+
* - ../../../golang/cosmos/vm/action.go
|
|
7
|
+
* - ../../../golang/cosmos/app/app.go
|
|
8
|
+
* - ../../../golang/cosmos/x/swingset/abci.go
|
|
9
|
+
* - ../../../golang/cosmos/x/swingset/keeper/swing_store_exports_handler.go
|
|
10
|
+
* - ../../cosmic-swingset/src/chain-main.js
|
|
11
|
+
* - ../../cosmic-swingset/src/launch-chain.js
|
|
12
|
+
*/
|
|
13
|
+
export type SwingsetMessageType = (typeof SwingsetMessageType)[keyof typeof SwingsetMessageType];
|
|
14
|
+
export namespace SwingsetMessageType {
|
|
15
|
+
let AG_COSMOS_INIT: "AG_COSMOS_INIT";
|
|
16
|
+
let BEGIN_BLOCK: "BEGIN_BLOCK";
|
|
17
|
+
let END_BLOCK: "END_BLOCK";
|
|
18
|
+
let COMMIT_BLOCK: "COMMIT_BLOCK";
|
|
19
|
+
let AFTER_COMMIT_BLOCK: "AFTER_COMMIT_BLOCK";
|
|
20
|
+
let SWING_STORE_EXPORT: "SWING_STORE_EXPORT";
|
|
21
|
+
}
|
|
1
22
|
export const AG_COSMOS_INIT: "AG_COSMOS_INIT";
|
|
2
|
-
export const SWING_STORE_EXPORT: "SWING_STORE_EXPORT";
|
|
3
23
|
export const BEGIN_BLOCK: "BEGIN_BLOCK";
|
|
4
|
-
export const CALCULATE_FEES_IN_BEANS: "CALCULATE_FEES_IN_BEANS";
|
|
5
|
-
export const CORE_EVAL: "CORE_EVAL";
|
|
6
|
-
export const DELIVER_INBOUND: "DELIVER_INBOUND";
|
|
7
24
|
export const END_BLOCK: "END_BLOCK";
|
|
8
25
|
export const COMMIT_BLOCK: "COMMIT_BLOCK";
|
|
9
26
|
export const AFTER_COMMIT_BLOCK: "AFTER_COMMIT_BLOCK";
|
|
27
|
+
export const SWING_STORE_EXPORT: "SWING_STORE_EXPORT";
|
|
28
|
+
/**
|
|
29
|
+
* Types of "action" messages consumed by the swingset VM from actionQueue or
|
|
30
|
+
* highPriorityQueue during END_BLOCK. See:
|
|
31
|
+
*
|
|
32
|
+
* - ../../../golang/cosmos/x/swingset/keeper/msg_server.go
|
|
33
|
+
* - ../../../golang/cosmos/x/swingset/keeper/proposal.go
|
|
34
|
+
* - ../../../golang/cosmos/x/vbank/vbank.go
|
|
35
|
+
* - ../../../golang/cosmos/x/vibc/handler.go
|
|
36
|
+
* - ../../../golang/cosmos/x/vibc/keeper/triggers.go
|
|
37
|
+
* - ../../../golang/cosmos/x/vibc/types/ibc_module.go
|
|
38
|
+
*/
|
|
39
|
+
export type QueuedActionType = (typeof QueuedActionType)[keyof typeof QueuedActionType];
|
|
40
|
+
export namespace QueuedActionType {
|
|
41
|
+
let CORE_EVAL: "CORE_EVAL";
|
|
42
|
+
let DELIVER_INBOUND: "DELIVER_INBOUND";
|
|
43
|
+
let IBC_EVENT: "IBC_EVENT";
|
|
44
|
+
let INSTALL_BUNDLE: "INSTALL_BUNDLE";
|
|
45
|
+
let PLEASE_PROVISION: "PLEASE_PROVISION";
|
|
46
|
+
let VBANK_BALANCE_UPDATE: "VBANK_BALANCE_UPDATE";
|
|
47
|
+
let WALLET_ACTION: "WALLET_ACTION";
|
|
48
|
+
let WALLET_SPEND_ACTION: "WALLET_SPEND_ACTION";
|
|
49
|
+
}
|
|
50
|
+
export const CORE_EVAL: "CORE_EVAL";
|
|
51
|
+
export const DELIVER_INBOUND: "DELIVER_INBOUND";
|
|
10
52
|
export const IBC_EVENT: "IBC_EVENT";
|
|
53
|
+
export const INSTALL_BUNDLE: "INSTALL_BUNDLE";
|
|
11
54
|
export const PLEASE_PROVISION: "PLEASE_PROVISION";
|
|
12
55
|
export const VBANK_BALANCE_UPDATE: "VBANK_BALANCE_UPDATE";
|
|
13
56
|
export const WALLET_ACTION: "WALLET_ACTION";
|
|
14
57
|
export const WALLET_SPEND_ACTION: "WALLET_SPEND_ACTION";
|
|
15
|
-
export const
|
|
58
|
+
export const CALCULATE_FEES_IN_BEANS: "CALCULATE_FEES_IN_BEANS";
|
|
16
59
|
export const VTRANSFER_IBC_EVENT: "VTRANSFER_IBC_EVENT";
|
|
60
|
+
export const KERNEL_UPGRADE_EVENTS: "KERNEL_UPGRADE_EVENTS";
|
|
17
61
|
//# sourceMappingURL=action-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-types.d.ts","sourceRoot":"","sources":["action-types.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"action-types.d.ts","sourceRoot":"","sources":["action-types.js"],"names":[],"mappings":";;;;;;;;;;;;kCAcU,CAAC,OAAO,mBAAmB,EAAE,MAAM,OAAO,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;+BAiC9D,CAAC,OAAO,gBAAgB,EAAE,MAAM,OAAO,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;AA0BlE,sCAAuC,yBAAyB,CAAC;AACjE,kCAAmC,qBAAqB,CAAC;AACzD,oCAAqC,uBAAuB,CAAC"}
|
package/src/action-types.js
CHANGED
|
@@ -1,18 +1,76 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Types of messages used for communication between a cosmos-sdk blockchain node
|
|
5
|
+
* and its paired swingset VM, especially for the ABCI lifecycle. See:
|
|
6
|
+
*
|
|
7
|
+
* - https://github.com/tendermint/tendermint/blob/v0.34.x/spec/abci/abci.md#block-execution
|
|
8
|
+
* - ../../../golang/cosmos/vm/action.go
|
|
9
|
+
* - ../../../golang/cosmos/app/app.go
|
|
10
|
+
* - ../../../golang/cosmos/x/swingset/abci.go
|
|
11
|
+
* - ../../../golang/cosmos/x/swingset/keeper/swing_store_exports_handler.go
|
|
12
|
+
* - ../../cosmic-swingset/src/chain-main.js
|
|
13
|
+
* - ../../cosmic-swingset/src/launch-chain.js
|
|
14
|
+
*
|
|
15
|
+
* @enum {(typeof SwingsetMessageType)[keyof typeof SwingsetMessageType]}
|
|
16
|
+
*/
|
|
17
|
+
export const SwingsetMessageType = /** @type {const} */ ({
|
|
18
|
+
AG_COSMOS_INIT: 'AG_COSMOS_INIT', // used to synchronize at process launch
|
|
19
|
+
BEGIN_BLOCK: 'BEGIN_BLOCK',
|
|
20
|
+
END_BLOCK: 'END_BLOCK',
|
|
21
|
+
COMMIT_BLOCK: 'COMMIT_BLOCK',
|
|
22
|
+
AFTER_COMMIT_BLOCK: 'AFTER_COMMIT_BLOCK',
|
|
23
|
+
SWING_STORE_EXPORT: 'SWING_STORE_EXPORT', // used to synchronize data export
|
|
24
|
+
});
|
|
25
|
+
harden(SwingsetMessageType);
|
|
26
|
+
|
|
27
|
+
// TODO: Update all imports to use SwingsetMessageType. But until then...
|
|
28
|
+
export const {
|
|
29
|
+
AG_COSMOS_INIT,
|
|
30
|
+
BEGIN_BLOCK,
|
|
31
|
+
END_BLOCK,
|
|
32
|
+
COMMIT_BLOCK,
|
|
33
|
+
AFTER_COMMIT_BLOCK,
|
|
34
|
+
SWING_STORE_EXPORT,
|
|
35
|
+
} = SwingsetMessageType;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Types of "action" messages consumed by the swingset VM from actionQueue or
|
|
39
|
+
* highPriorityQueue during END_BLOCK. See:
|
|
40
|
+
*
|
|
41
|
+
* - ../../../golang/cosmos/x/swingset/keeper/msg_server.go
|
|
42
|
+
* - ../../../golang/cosmos/x/swingset/keeper/proposal.go
|
|
43
|
+
* - ../../../golang/cosmos/x/vbank/vbank.go
|
|
44
|
+
* - ../../../golang/cosmos/x/vibc/handler.go
|
|
45
|
+
* - ../../../golang/cosmos/x/vibc/keeper/triggers.go
|
|
46
|
+
* - ../../../golang/cosmos/x/vibc/types/ibc_module.go
|
|
47
|
+
*
|
|
48
|
+
* @enum {(typeof QueuedActionType)[keyof typeof QueuedActionType]}
|
|
49
|
+
*/
|
|
50
|
+
export const QueuedActionType = /** @type {const} */ ({
|
|
51
|
+
CORE_EVAL: 'CORE_EVAL',
|
|
52
|
+
DELIVER_INBOUND: 'DELIVER_INBOUND',
|
|
53
|
+
IBC_EVENT: 'IBC_EVENT',
|
|
54
|
+
INSTALL_BUNDLE: 'INSTALL_BUNDLE',
|
|
55
|
+
PLEASE_PROVISION: 'PLEASE_PROVISION',
|
|
56
|
+
VBANK_BALANCE_UPDATE: 'VBANK_BALANCE_UPDATE',
|
|
57
|
+
WALLET_ACTION: 'WALLET_ACTION',
|
|
58
|
+
WALLET_SPEND_ACTION: 'WALLET_SPEND_ACTION',
|
|
59
|
+
});
|
|
60
|
+
harden(QueuedActionType);
|
|
61
|
+
|
|
62
|
+
// TODO: Update all imports to use QueuedActionType. But until then...
|
|
63
|
+
export const {
|
|
64
|
+
CORE_EVAL,
|
|
65
|
+
DELIVER_INBOUND,
|
|
66
|
+
IBC_EVENT,
|
|
67
|
+
INSTALL_BUNDLE,
|
|
68
|
+
PLEASE_PROVISION,
|
|
69
|
+
VBANK_BALANCE_UPDATE,
|
|
70
|
+
WALLET_ACTION,
|
|
71
|
+
WALLET_SPEND_ACTION,
|
|
72
|
+
} = QueuedActionType;
|
|
73
|
+
|
|
6
74
|
export const CALCULATE_FEES_IN_BEANS = 'CALCULATE_FEES_IN_BEANS';
|
|
7
|
-
export const CORE_EVAL = 'CORE_EVAL';
|
|
8
|
-
export const DELIVER_INBOUND = 'DELIVER_INBOUND';
|
|
9
|
-
export const END_BLOCK = 'END_BLOCK';
|
|
10
|
-
export const COMMIT_BLOCK = 'COMMIT_BLOCK';
|
|
11
|
-
export const AFTER_COMMIT_BLOCK = 'AFTER_COMMIT_BLOCK';
|
|
12
|
-
export const IBC_EVENT = 'IBC_EVENT';
|
|
13
|
-
export const PLEASE_PROVISION = 'PLEASE_PROVISION';
|
|
14
|
-
export const VBANK_BALANCE_UPDATE = 'VBANK_BALANCE_UPDATE';
|
|
15
|
-
export const WALLET_ACTION = 'WALLET_ACTION';
|
|
16
|
-
export const WALLET_SPEND_ACTION = 'WALLET_SPEND_ACTION';
|
|
17
|
-
export const INSTALL_BUNDLE = 'INSTALL_BUNDLE';
|
|
18
75
|
export const VTRANSFER_IBC_EVENT = 'VTRANSFER_IBC_EVENT';
|
|
76
|
+
export const KERNEL_UPGRADE_EVENTS = 'KERNEL_UPGRADE_EVENTS';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batched-deliver.d.ts","sourceRoot":"","sources":["batched-deliver.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;;;;;GAOG;AACH,4CAPW,eAAe,gCACf;
|
|
1
|
+
{"version":3,"file":"batched-deliver.d.ts","sourceRoot":"","sources":["batched-deliver.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;;;;;GAOG;AACH,4CAPW,eAAe,gCACf;IACN,YAAY,EAAE,8BAAkC,CAAC;IACjD,UAAU,EAAE,4BAAgC,CAAC;CAC9C,mBACO,MAAM,aATM,OAAO,EAAE,UAAU,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAiDjE;AApDD,uCAAwC,IAAI,CAAC;8BAGhC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC"}
|
package/src/callback.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export function prepareAttenuator<M extends PropertyKey>(zone: import("@agoric/b
|
|
|
15
15
|
}) => import("@endo/exo").Guarded<{ [K_2 in M]: (this: any, ...args: any[]) => any; }>;
|
|
16
16
|
export function prepareGuardedAttenuator<G extends import("@endo/patterns").InterfaceGuard>(zone: import("@agoric/base-zone").Zone, interfaceGuard: G, opts?: {
|
|
17
17
|
tag?: string | undefined;
|
|
18
|
-
}
|
|
18
|
+
}): MakeAttenuator<any>;
|
|
19
19
|
export type MakeAttenuator<T extends import("@endo/exo").Methods> = (...args: Parameters<ReturnType<(<M extends PropertyKey>(zone: import("@agoric/base-zone").Zone, methodNames: M[], { interfaceGuard, tag }?: {
|
|
20
20
|
interfaceGuard?: import("@endo/patterns").InterfaceGuard<{ [K in M]: import("@endo/patterns").MethodGuard; }> | undefined;
|
|
21
21
|
tag?: string | undefined;
|
package/src/callback.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["callback.js"],"names":[],"mappings":"AAgDO,yBALgC,CAAC,SAA3B,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAI,YAC3B,aAAa,CAAC,CAAC,WACf,UAAU,CAAC,CAAC,CAAC,GACX,UAAU,CAAC,CAAC,CAAC,CAQzB;AAWM,sBALgC,CAAC,SAA3B,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAI,YAC3B,SAAS,CAAC,CAAC,WACX,UAAU,CAAC,CAAC,CAAC,GACX,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAQ3C;AAaM,yCAPgC,CAAC,SAA3B,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAI,EAC+B,CAAC,SAAzD,CAAE,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAE,MAC7C,CAAC,SAAT,GAAG,EAAG,eACT,CAAC,YACD,CAAC,GACC,aAAa,CAAC,CAAC,CAQ3B;AAaM,qCAPgC,CAAC,SAA3B,CAAE,GAAG,IAAI,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SAA3C,OAAQ,gBAAgB,EAAE,cAAe,QAC3C,OAAO,mBAAmB,EAAE,IAAI,kBAChC,CAAC,SAET;IAAsB,GAAG;CAAC,GAQT,cAAc,CAAC,GAAG,CAAC,CACtC;2BAvS0C,CAAC,SAA/B,OAAQ,WAAW,EAAE,OAAQ,IAC7B,CACZ,GAAO,IAAI,EAAE,UAAU,CAAC,UAAU,GAqKR,CAAC,SAAd,WAAY,QACf,OAAO,mBAAmB,EAAE,IAAI,eAEhC,CAAC,EAAE,4BAEX;IAEU,cAAc,8CADrB,CAAC;IAGkB,GAAG;CAC3B;aAgEc,GAAG;;;uDArDgB,GAAG,WAAW,GAAG,EAAE,KAAK,GAAG,MA1LP,CAAC,KAC/C,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;kCAdI,YAAY;8BAAZ,YAAY;0BAD9B,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-storage-paths.d.ts","sourceRoot":"","sources":["chain-storage-paths.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"chain-storage-paths.d.ts","sourceRoot":"","sources":["chain-storage-paths.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,2BAA4B,aAAa,CAAC;AAC1C,kCAAmC,mBAAmB,CAAC;AACvD,oCAAqC,qBAAqB,CAAC;AAC3D,yBAA0B,YAAY,CAAC;AACvC,qBAAsB,QAAQ,CAAC;AAC/B,sBAAuB,SAAS,CAAC;AACjC,sBAAuB,SAAS,CAAC;AACjC,qBAAsB,WAAW,CAAC;AAClC,0BAA2B,YAAY,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function makeInitMsg(initAction: any): InitMsg;
|
|
2
|
+
export type NatString = `${bigint}`;
|
|
3
|
+
export type BlockInfo = {
|
|
4
|
+
blockHeight: number;
|
|
5
|
+
/**
|
|
6
|
+
* POSIX Seconds Since the Epoch
|
|
7
|
+
*/
|
|
8
|
+
blockTime: number;
|
|
9
|
+
params: import("@agoric/cosmic-proto/swingset/swingset.js").ParamsSDKType;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* cosmosInitAction fields that are subject to consensus. See cosmosInitAction
|
|
13
|
+
* in {@link ../../../golang/cosmos/app/app.go}.
|
|
14
|
+
*/
|
|
15
|
+
export type InitMsg = BlockInfo & {
|
|
16
|
+
type: typeof _ActionType.AG_COSMOS_INIT;
|
|
17
|
+
chainID: string;
|
|
18
|
+
isBootstrap?: boolean;
|
|
19
|
+
supplyCoins: {
|
|
20
|
+
denom: string;
|
|
21
|
+
amount: NatString;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
import * as _ActionType from './action-types.js';
|
|
25
|
+
//# sourceMappingURL=chain-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-utils.d.ts","sourceRoot":"","sources":["chain-utils.js"],"names":[],"mappings":"AAsCO,wCAHI,GAAG,GACD,OAAO,CAoBnB;wBA1Ca,GAAG,MAAM,EAAE;;iBAIX,MAAM;;;;eACN,MAAM;YACN,OAAO,2CAA2C,EAAE,aAAa;;;;;;sBAIlE,SAAS,GAAG;IACpB,IAAI,EAAE,OAAO,WAAW,CAAC,cAAc,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;CACrD;6BAjByB,mBAAmB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Types and utilities for supporting blockchain functionality without
|
|
3
|
+
* risking import cycles.
|
|
4
|
+
*
|
|
5
|
+
* TODO: Integrate (or integrate with) any/all of:
|
|
6
|
+
*
|
|
7
|
+
* - ./action-types.js
|
|
8
|
+
* - ./chain-storage-paths.js
|
|
9
|
+
* - ./config.js
|
|
10
|
+
* - ../../cosmic-proto (if comfortable co-residing with generated code)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as _ActionType from './action-types.js';
|
|
14
|
+
|
|
15
|
+
/** @typedef {`${bigint}`} NatString */
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {object} BlockInfo
|
|
19
|
+
* @property {number} blockHeight
|
|
20
|
+
* @property {number} blockTime POSIX Seconds Since the Epoch
|
|
21
|
+
* @property {import('@agoric/cosmic-proto/swingset/swingset.js').ParamsSDKType} params
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {BlockInfo & {
|
|
26
|
+
* type: typeof _ActionType.AG_COSMOS_INIT;
|
|
27
|
+
* chainID: string;
|
|
28
|
+
* isBootstrap?: boolean;
|
|
29
|
+
* supplyCoins: { denom: string; amount: NatString }[];
|
|
30
|
+
* }} InitMsg
|
|
31
|
+
* cosmosInitAction fields that are subject to consensus. See cosmosInitAction
|
|
32
|
+
* in {@link ../../../golang/cosmos/app/app.go}.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {any} initAction
|
|
37
|
+
* @returns {InitMsg}
|
|
38
|
+
*/
|
|
39
|
+
export const makeInitMsg = initAction => {
|
|
40
|
+
const {
|
|
41
|
+
type,
|
|
42
|
+
blockHeight,
|
|
43
|
+
blockTime,
|
|
44
|
+
chainID,
|
|
45
|
+
params,
|
|
46
|
+
// NB: resolvedConfig is independent of consensus and MUST NOT be included
|
|
47
|
+
supplyCoins,
|
|
48
|
+
} = initAction;
|
|
49
|
+
return {
|
|
50
|
+
type,
|
|
51
|
+
blockHeight,
|
|
52
|
+
blockTime,
|
|
53
|
+
chainID,
|
|
54
|
+
params,
|
|
55
|
+
supplyCoins,
|
|
56
|
+
};
|
|
57
|
+
};
|
package/src/config.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event source ids used by the bridge device.
|
|
3
|
+
*/
|
|
4
|
+
export type BridgeId = (typeof BridgeId)[keyof typeof BridgeId];
|
|
1
5
|
export namespace BridgeId {
|
|
2
6
|
let BANK: "bank";
|
|
3
7
|
let CORE: "core";
|
|
@@ -30,5 +34,4 @@ export namespace VBankAccount {
|
|
|
30
34
|
export { address_1 as address };
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
|
-
export type BridgeIdValue = (typeof BridgeId)[keyof typeof BridgeId];
|
|
34
37
|
//# sourceMappingURL=config.d.ts.map
|
package/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.js"],"names":[],"mappings":";;;uBAkBU,CAAC,OAAO,QAAQ,EAAE,MAAM,OAAO,QAAQ,CAAC"}
|
package/src/config.js
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Event source ids used by the bridge device.
|
|
18
|
+
*
|
|
19
|
+
* @enum {(typeof BridgeId)[keyof typeof BridgeId]}
|
|
18
20
|
*/
|
|
19
21
|
export const BridgeId = /** @type {const} */ ({
|
|
20
22
|
BANK: 'bank',
|
|
@@ -28,7 +30,6 @@ export const BridgeId = /** @type {const} */ ({
|
|
|
28
30
|
WALLET: 'wallet',
|
|
29
31
|
});
|
|
30
32
|
harden(BridgeId);
|
|
31
|
-
/** @typedef {(typeof BridgeId)[keyof typeof BridgeId]} BridgeIdValue */
|
|
32
33
|
|
|
33
34
|
export const CosmosInitKeyToBridgeId = {
|
|
34
35
|
vbankPort: BridgeId.BANK,
|
package/src/errors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function NonNullish<T>(val: T | null | undefined, optDetails?: string
|
|
1
|
+
export function NonNullish<T>(val: T | null | undefined, optDetails?: string): T;
|
|
2
2
|
//# sourceMappingURL=errors.d.ts.map
|
package/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["errors.js"],"names":[],"mappings":"AAQO,2BALM,CAAC,OACH,CAAC,GAAG,IAAI,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["errors.js"],"names":[],"mappings":"AAQO,2BALM,CAAC,OACH,CAAC,GAAG,IAAI,GAAG,SAAS,eACpB,MAAM,GACJ,CAAC,CAQb"}
|
package/src/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from "./config.js";
|
|
2
2
|
export * from "./debug.js";
|
|
3
3
|
export * from "./errors.js";
|
|
4
|
-
export * from "./utils.js";
|
|
4
|
+
export * from "./js-utils.js";
|
|
5
5
|
export * from "./method-tools.js";
|
|
6
|
+
export * from "./ses-utils.js";
|
|
6
7
|
export * from "./typeCheck.js";
|
|
7
8
|
export * from "./typeGuards.js";
|
|
8
|
-
export * from "./types.js";
|
|
9
|
+
export * from "./types-index.js";
|
|
10
|
+
export { pureDataMarshaller } from "./marshal.js";
|
|
9
11
|
export { objectMap } from "@endo/common/object-map.js";
|
|
10
12
|
export { objectMetaMap } from "@endo/common/object-meta-map.js";
|
|
11
13
|
export { fromUniqueEntries } from "@endo/common/from-unique-entries.js";
|
package/src/index.js
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
export * from './config.js';
|
|
6
6
|
export * from './debug.js';
|
|
7
7
|
export * from './errors.js';
|
|
8
|
-
export * from './utils.js';
|
|
8
|
+
export * from './js-utils.js';
|
|
9
|
+
export { pureDataMarshaller } from './marshal.js';
|
|
9
10
|
export * from './method-tools.js';
|
|
11
|
+
export * from './ses-utils.js';
|
|
10
12
|
export * from './typeCheck.js';
|
|
11
13
|
export * from './typeGuards.js';
|
|
12
14
|
|
|
13
15
|
// eslint-disable-next-line import/export -- just types
|
|
14
|
-
export * from './types.js';
|
|
16
|
+
export * from './types-index.js';
|
|
15
17
|
|
|
16
18
|
export { objectMap } from '@endo/common/object-map.js';
|
|
17
19
|
export { objectMetaMap } from '@endo/common/object-meta-map.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function deepCopyJsonable<T>(value: T): T;
|
|
2
|
+
export function deepMapObject(obj: object, mapper: (value: any, name: string, record: object) => any): object;
|
|
3
|
+
export function makeMeasureSeconds(currentTimeMillisec: () => number): <T>(fn: () => Promise<T>) => Promise<{
|
|
4
|
+
result: T;
|
|
5
|
+
duration: number;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=js-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-utils.d.ts","sourceRoot":"","sources":["js-utils.js"],"names":[],"mappings":"AAgBO,iCAJM,CAAC,SACH,CAAC,GACC,CAAC,CAE4D;AAiDnE,mCAJI,MAAM,UACN,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,GAC/C,MAAM,CAGuC;AASnD,wDAFI,MAAM,MAAM,IAIR,CAAC,MACH,MAAM,OAAO,CAAC,CAAC,CAAC,KACd,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAStD"}
|
package/src/js-utils.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// @jessie-check
|
|
3
|
+
/**
|
|
4
|
+
* @file Pure JavaScript utility functions that are compatible with but not
|
|
5
|
+
* dependent upon a hardened environment.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Deep-copy a value by round-tripping it through JSON (which drops
|
|
10
|
+
* function/symbol/undefined values and properties that are non-enumerable
|
|
11
|
+
* and/or symbol-keyed, and rejects bigint values).
|
|
12
|
+
*
|
|
13
|
+
* @template T
|
|
14
|
+
* @param {T} value
|
|
15
|
+
* @returns {T}
|
|
16
|
+
*/
|
|
17
|
+
export const deepCopyJsonable = value => JSON.parse(JSON.stringify(value));
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {any} value
|
|
21
|
+
* @param {string | undefined} name
|
|
22
|
+
* @param {object | undefined} container
|
|
23
|
+
* @param {(value: any, name: string, record: object) => any} mapper
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
const deepMapObjectInternal = (value, name, container, mapper) => {
|
|
27
|
+
if (container && typeof name === 'string') {
|
|
28
|
+
const mapped = mapper(value, name, container);
|
|
29
|
+
if (mapped !== value) {
|
|
30
|
+
return mapped;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (typeof value !== 'object' || !value) {
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let wasMapped = false;
|
|
39
|
+
const mappedEntries = Object.entries(value).map(([innerName, innerValue]) => {
|
|
40
|
+
const mappedInnerValue = deepMapObjectInternal(
|
|
41
|
+
innerValue,
|
|
42
|
+
innerName,
|
|
43
|
+
value,
|
|
44
|
+
mapper,
|
|
45
|
+
);
|
|
46
|
+
wasMapped ||= mappedInnerValue !== innerValue;
|
|
47
|
+
return [innerName, mappedInnerValue];
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return wasMapped ? Object.fromEntries(mappedEntries) : value;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Recursively traverses a record object structure, calling a mapper function
|
|
55
|
+
* for each enumerable string-keyed property and returning a record composed of
|
|
56
|
+
* the results. If none of the values are changed, the original object is
|
|
57
|
+
* returned, maintaining its identity.
|
|
58
|
+
*
|
|
59
|
+
* When the property value is an object, it is sent to the mapper like any other
|
|
60
|
+
* value, and then recursively traversed unless replaced with a distinct value.
|
|
61
|
+
*
|
|
62
|
+
* @param {object} obj
|
|
63
|
+
* @param {(value: any, name: string, record: object) => any} mapper
|
|
64
|
+
* @returns {object}
|
|
65
|
+
*/
|
|
66
|
+
export const deepMapObject = (obj, mapper) =>
|
|
67
|
+
deepMapObjectInternal(obj, undefined, undefined, mapper);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns a function that uses a millisecond-based current-time capability
|
|
71
|
+
* (such as `performance.now`) to measure execution duration of an async
|
|
72
|
+
* function and report the result in seconds to match our telemetry standard.
|
|
73
|
+
*
|
|
74
|
+
* @param {() => number} currentTimeMillisec
|
|
75
|
+
*/
|
|
76
|
+
export const makeMeasureSeconds = currentTimeMillisec => {
|
|
77
|
+
/**
|
|
78
|
+
* @template T
|
|
79
|
+
* @param {() => Promise<T>} fn
|
|
80
|
+
* @returns {Promise<{ result: T; duration: number }>}
|
|
81
|
+
*/
|
|
82
|
+
const measureSeconds = async fn => {
|
|
83
|
+
const t0 = currentTimeMillisec();
|
|
84
|
+
const result = await fn();
|
|
85
|
+
const durationMillisec = currentTimeMillisec() - t0;
|
|
86
|
+
return { result, duration: durationMillisec / 1000 };
|
|
87
|
+
};
|
|
88
|
+
return measureSeconds;
|
|
89
|
+
};
|
|
@@ -13,23 +13,12 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export function makeChainStorageRoot(handleStorageMessage: (message: StorageMessage) => any, rootPath: string, rootOptions?: {
|
|
15
15
|
sequence?: boolean | undefined;
|
|
16
|
-
}
|
|
16
|
+
}): import("@endo/exo").Guarded<{
|
|
17
17
|
getPath(): string;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated use getPath
|
|
20
|
-
* @type {() => Promise<VStorageKey>}
|
|
21
|
-
*/
|
|
22
18
|
getStoreKey(): Promise<VStorageKey>;
|
|
23
|
-
/**
|
|
24
|
-
* @type {(
|
|
25
|
-
* name: string,
|
|
26
|
-
* childNodeOptions?: { sequence?: boolean },
|
|
27
|
-
* ) => StorageNode}
|
|
28
|
-
*/
|
|
29
19
|
makeChildNode(name: string, childNodeOptions?: {
|
|
30
20
|
sequence?: boolean;
|
|
31
21
|
}): StorageNode;
|
|
32
|
-
/** @type {(value: string) => Promise<void>} */
|
|
33
22
|
setValue(value: string): Promise<void>;
|
|
34
23
|
}>;
|
|
35
24
|
/**
|
|
@@ -50,21 +39,10 @@ export function prepareChainStorageNode(zone: import("@agoric/base-zone").Zone):
|
|
|
50
39
|
sequence?: boolean | undefined;
|
|
51
40
|
} | undefined) => import("@endo/exo").Guarded<{
|
|
52
41
|
getPath(): string;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated use getPath
|
|
55
|
-
* @type {() => Promise<VStorageKey>}
|
|
56
|
-
*/
|
|
57
42
|
getStoreKey(): Promise<VStorageKey>;
|
|
58
|
-
/**
|
|
59
|
-
* @type {(
|
|
60
|
-
* name: string,
|
|
61
|
-
* childNodeOptions?: { sequence?: boolean },
|
|
62
|
-
* ) => StorageNode}
|
|
63
|
-
*/
|
|
64
43
|
makeChildNode(name: string, childNodeOptions?: {
|
|
65
44
|
sequence?: boolean;
|
|
66
45
|
}): StorageNode;
|
|
67
|
-
/** @type {(value: string) => Promise<void>} */
|
|
68
46
|
setValue(value: string): Promise<void>;
|
|
69
47
|
}>;
|
|
70
48
|
export function makeSerializeToStorage(storageNode: ERef<StorageNode>, marshaller: ERef<Marshaller>): (value: PassableCap) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-chainStorage.d.ts","sourceRoot":"","sources":["lib-chainStorage.js"],"names":[],"mappings":"AAyPA;;;;;;;;;;;;GAYG;AACH,2DATW,CAAC,OAAO,EAAE,cAAc,KAAK,GAAG,YAGhC,MAAM
|
|
1
|
+
{"version":3,"file":"lib-chainStorage.d.ts","sourceRoot":"","sources":["lib-chainStorage.js"],"names":[],"mappings":"AAyPA;;;;;;;;;;;;GAYG;AACH,2DATW,CAAC,OAAO,EAAE,cAAc,KAAK,GAAG,YAGhC,MAAM,gBAEd;IAA8B,QAAQ;CAGxC;;mBAnEqB,O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,OAAO,CAAA;KAAE,KAC7B,WAAW;;;;;;;aA6CL,MAAM,OAAO,CAAC,MAAM,CAAC;;;;iBAErB,WAAW,CAAC,aAAa,CAAC;;;;;qBAC1B,MAAM,YAAY;;;;;4CAqBnB,KAAK,GACX,aAAa,GACb,KAAK,GACL,UAAU,GACV,SAAS,GACT,QAAQ,GACR,MAAM;;;;gDAGA,KAAK,GAAG,kBAAkB,GAAG,QAAQ;;;;mCAGrC,6BAA6B,GACnC,iCAAiC;;;;0CAG3B,CAAC,IAAI,EAAE,MAAM,CAAC;;;;2BAEd,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;;;;8CAErC,YAAY,EAAE;;;;6BAEd;IACJ,MAAM,EAAE,6BAA6B,CAAC;IACtC,IAAI,EAAE,2BAA2B,CAAC;CACnC,GACD;IACE,MAAM,EAAE,iCAAiC,CAAC;IAC1C,IAAI,EAAE,+BAA+B,CAAC;CACvC;0BA5Ie,WAAW;iCACJ,eAAe"}
|
package/src/lib-chainStorage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
3
|
import { Fail } from '@endo/errors';
|
|
4
|
-
import { E } from '@endo/far';
|
|
4
|
+
import { E, Far } from '@endo/far';
|
|
5
5
|
import { M } from '@endo/patterns';
|
|
6
6
|
import { makeHeapZone } from '@agoric/base-zone/heap.js';
|
|
7
7
|
import * as cb from './callback.js';
|
|
@@ -278,7 +278,10 @@ export function makeChainStorageRoot(
|
|
|
278
278
|
*/
|
|
279
279
|
const makeNullStorageNode = () => {
|
|
280
280
|
// XXX re-use "ChainStorage" methods above which don't actually depend on chains
|
|
281
|
-
return makeChainStorageRoot(
|
|
281
|
+
return makeChainStorageRoot(
|
|
282
|
+
Far('NullMessenger', () => null),
|
|
283
|
+
'null',
|
|
284
|
+
);
|
|
282
285
|
};
|
|
283
286
|
|
|
284
287
|
/**
|