@agoric/vats 0.15.2-dev-286302a.0 → 0.15.2-dev-8e94b2a.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-286302a.0+286302a",
3
+ "version": "0.15.2-dev-8e94b2a.0+8e94b2a",
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/assert": "0.6.1-dev-286302a.0+286302a",
26
- "@agoric/cosmic-proto": "0.4.1-dev-286302a.0+286302a",
27
- "@agoric/ertp": "0.16.3-dev-286302a.0+286302a",
28
- "@agoric/governance": "0.10.4-dev-286302a.0+286302a",
29
- "@agoric/internal": "0.3.3-dev-286302a.0+286302a",
30
- "@agoric/network": "0.1.1-dev-286302a.0+286302a",
31
- "@agoric/notifier": "0.6.3-dev-286302a.0+286302a",
32
- "@agoric/store": "0.9.3-dev-286302a.0+286302a",
33
- "@agoric/swingset-vat": "0.32.3-dev-286302a.0+286302a",
34
- "@agoric/time": "0.3.3-dev-286302a.0+286302a",
35
- "@agoric/vat-data": "0.5.3-dev-286302a.0+286302a",
36
- "@agoric/zoe": "0.26.3-dev-286302a.0+286302a",
37
- "@agoric/zone": "0.2.3-dev-286302a.0+286302a",
25
+ "@agoric/assert": "0.6.1-dev-8e94b2a.0+8e94b2a",
26
+ "@agoric/cosmic-proto": "0.4.1-dev-8e94b2a.0+8e94b2a",
27
+ "@agoric/ertp": "0.16.3-dev-8e94b2a.0+8e94b2a",
28
+ "@agoric/governance": "0.10.4-dev-8e94b2a.0+8e94b2a",
29
+ "@agoric/internal": "0.3.3-dev-8e94b2a.0+8e94b2a",
30
+ "@agoric/network": "0.1.1-dev-8e94b2a.0+8e94b2a",
31
+ "@agoric/notifier": "0.6.3-dev-8e94b2a.0+8e94b2a",
32
+ "@agoric/store": "0.9.3-dev-8e94b2a.0+8e94b2a",
33
+ "@agoric/swingset-vat": "0.32.3-dev-8e94b2a.0+8e94b2a",
34
+ "@agoric/time": "0.3.3-dev-8e94b2a.0+8e94b2a",
35
+ "@agoric/vat-data": "0.5.3-dev-8e94b2a.0+8e94b2a",
36
+ "@agoric/zoe": "0.26.3-dev-8e94b2a.0+8e94b2a",
37
+ "@agoric/zone": "0.2.3-dev-8e94b2a.0+8e94b2a",
38
38
  "@endo/base64": "^1.0.4",
39
39
  "@endo/far": "^1.1.1",
40
40
  "@endo/import-bundle": "^1.1.1",
@@ -46,7 +46,7 @@
46
46
  "jessie.js": "^0.3.4"
47
47
  },
48
48
  "devDependencies": {
49
- "@agoric/swingset-liveslots": "0.10.3-dev-286302a.0+286302a",
49
+ "@agoric/swingset-liveslots": "0.10.3-dev-8e94b2a.0+8e94b2a",
50
50
  "@endo/bundle-source": "^3.2.2",
51
51
  "@endo/init": "^1.1.1",
52
52
  "ava": "^5.3.0",
@@ -79,5 +79,5 @@
79
79
  "typeCoverage": {
80
80
  "atLeast": 91.5
81
81
  },
82
- "gitHead": "286302a192b9eb2e222faa08479f496645bb7b9a"
82
+ "gitHead": "8e94b2af44d002fbf1c6cd316ec309d24e82042e"
83
83
  }
@@ -47,6 +47,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
47
47
  getPortAllocator(): import("@endo/exo").Guarded<{
48
48
  allocateCustomIBCPort(specifiedName?: string): import("@agoric/vow").Vow<any>;
49
49
  allocateICAControllerPort(): import("@agoric/vow").Vow<any>;
50
+ allocateICQControllerPort(): import("@agoric/vow").Vow<any>;
50
51
  allocateCustomLocalPort(specifiedName?: string): import("@agoric/vow").Vow<any>;
51
52
  }>;
52
53
  } & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -111,6 +112,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
111
112
  getPortAllocator(): import("@endo/exo").Guarded<{
112
113
  allocateCustomIBCPort(specifiedName?: string): import("@agoric/vow").Vow<any>;
113
114
  allocateICAControllerPort(): import("@agoric/vow").Vow<any>;
115
+ allocateICQControllerPort(): import("@agoric/vow").Vow<any>;
114
116
  allocateCustomLocalPort(specifiedName?: string): import("@agoric/vow").Vow<any>;
115
117
  }>;
116
118
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"vat-network.d.ts","sourceRoot":"","sources":["vat-network.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BI,wEAAwE;;IAGxE,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAH1E,wEAAwE;;IAGxE,0EAA0E;;;;;;;GAO7E"}
1
+ {"version":3,"file":"vat-network.d.ts","sourceRoot":"","sources":["vat-network.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BI,wEAAwE;;IAGxE,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAH1E,wEAAwE;;IAGxE,0EAA0E;;;;;;;;GAO7E"}
@@ -1,6 +1,20 @@
1
1
  export const REMOTE_ADDR_RE: RegExp;
2
2
  /** @typedef {`/${string}ibc-port/${string}/${'ordered' | 'unordered'}/${string}`} RemoteIbcAddress */
3
3
  export const LOCAL_ADDR_RE: RegExp;
4
+ /**
5
+ * @overload
6
+ * @param {string} remoteAddr
7
+ * @param {undefined | false} [returnMatch]
8
+ * @returns {boolean}
9
+ */
10
+ export function validateRemoteIbcAddress(remoteAddr: string, returnMatch?: undefined | false): boolean;
11
+ /**
12
+ * @overload
13
+ * @param {string} remoteAddr
14
+ * @param {true} returnMatch
15
+ * @returns {RegExpMatchArray}
16
+ */
17
+ export function validateRemoteIbcAddress(remoteAddr: string, returnMatch: true): RegExpMatchArray;
4
18
  export function decodeRemoteIbcAddress(remoteAddr: string): {
5
19
  rPortID: string;
6
20
  hops: `connection-${number}`[];
@@ -1 +1 @@
1
- {"version":3,"file":"ibc-utils.d.ts","sourceRoot":"","sources":["ibc-utils.js"],"names":[],"mappings":"AAAA,oCAC8G;AAE9G,sGAAsG;AAEtG,mCAA+E;AAIxE,mDADK,MAAM;;;;;EA8BjB;AAOM,6CAHI,eAAe,GACb,MAAM,CAWlB;AAWM,6CAPI,MAAM,EAAE,WACR,MAAM,SACN,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,YACjD,MAAM,cACN,MAAM,GACJ,gBAAgB,CAa5B;AAQM,8CAJI,MAAM,SACN,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,WACjD,MAAM,UAIhB;+BAnFa,IAAI,MAAM,YAAY,MAAM,IAAI,SAAS,GAAG,WAAW,IAAI,MAAM,EAAE;8BAGnE,aAAa,MAAM,EAAE"}
1
+ {"version":3,"file":"ibc-utils.d.ts","sourceRoot":"","sources":["ibc-utils.js"],"names":[],"mappings":"AAAA,oCAC8G;AAE9G,sGAAsG;AAEtG,mCAA+E;;;;;;;AAI5E,qDACQ,MAAM,gBACN,SAAS,GAAG,KAAK,GACf,OAAO,CACnB;;;;;;;AAEE,qDACQ,MAAM,eACN,IAAI,GACF,gBAAgB,CAC5B;AAoBM,mDADK,MAAM;;;;;EA0BjB;AAOM,6CAHI,eAAe,GACb,MAAM,CAWlB;AAWM,6CAPI,MAAM,EAAE,WACR,MAAM,SACN,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,YACjD,MAAM,cACN,MAAM,GACJ,gBAAgB,CAa5B;AAQM,8CAJI,MAAM,SACN,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,WACjD,MAAM,UAIhB;+BA7Ga,IAAI,MAAM,YAAY,MAAM,IAAI,SAAS,GAAG,WAAW,IAAI,MAAM,EAAE;8BAGnE,aAAa,MAAM,EAAE"}
@@ -6,8 +6,26 @@ harden(REMOTE_ADDR_RE);
6
6
  export const LOCAL_ADDR_RE = /^\/ibc-port\/(?<portID>[-a-zA-Z0-9._+#[\]<>]+)$/;
7
7
  /** @typedef {`/ibc-port/${string}`} LocalIbcAddress */
8
8
 
9
- /** @param {string} remoteAddr */
10
- export const decodeRemoteIbcAddress = remoteAddr => {
9
+ /**
10
+ * @overload
11
+ * @param {string} remoteAddr
12
+ * @param {undefined | false} [returnMatch]
13
+ * @returns {boolean}
14
+ */
15
+ /**
16
+ * @overload
17
+ * @param {string} remoteAddr
18
+ * @param {true} returnMatch
19
+ * @returns {RegExpMatchArray}
20
+ */
21
+ /**
22
+ * Validates a remote IBC address format and returns true if the address is
23
+ * valid.
24
+ *
25
+ * @param {string} remoteAddr
26
+ * @param {boolean} [returnMatch]
27
+ */
28
+ export const validateRemoteIbcAddress = (remoteAddr, returnMatch = false) => {
11
29
  const match = remoteAddr.match(REMOTE_ADDR_RE);
12
30
  // .groups is to inform TS https://github.com/microsoft/TypeScript/issues/32098
13
31
  if (!(match && match.groups)) {
@@ -15,6 +33,14 @@ export const decodeRemoteIbcAddress = remoteAddr => {
15
33
  `Remote address ${remoteAddr} must be '(/ibc-hop/CONNECTION)*/ibc-port/PORT/(ordered|unordered)/VERSION'`,
16
34
  );
17
35
  }
36
+ return returnMatch ? match : true;
37
+ };
38
+
39
+ /** @param {string} remoteAddr */
40
+ export const decodeRemoteIbcAddress = remoteAddr => {
41
+ const match = validateRemoteIbcAddress(remoteAddr, true);
42
+ if (!match.groups)
43
+ throw Error('Unexpected error, validateRemoteIbcAddress should throw.');
18
44
 
19
45
  /** @type {import('../src/types.js').IBCConnectionID[]} */
20
46
  const hops = [];