@ocap/state 1.32.1 → 1.32.2

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.
@@ -73,8 +73,11 @@ const badUpdate = (message) => {
73
73
  };
74
74
  /** Whether a rollup `data` field (`{ type, value }`) is a v2 body. */
75
75
  function isBridgeV2Data(data) {
76
- const value = data?.value;
77
- return !!value && typeof value === "object" && value.version === BRIDGE_VERSION;
76
+ const d = data;
77
+ if (d?.type !== void 0 && d.type !== "json") return false;
78
+ if (d?.typeUrl !== void 0 && d.typeUrl !== "json") return false;
79
+ const value = d?.value;
80
+ return !!value && typeof value === "object" && !Array.isArray(value) && value.version === BRIDGE_VERSION;
78
81
  }
79
82
  /** Whether the rollup row is a v2 bridge. Rows without `data.value.version == 2` are v1 and keep today's behaviour. */
80
83
  function isBridgeV2(state) {
@@ -74,8 +74,11 @@ const badUpdate = (message) => {
74
74
  };
75
75
  /** Whether a rollup `data` field (`{ type, value }`) is a v2 body. */
76
76
  function isBridgeV2Data(data) {
77
- const value = data?.value;
78
- return !!value && typeof value === "object" && value.version === BRIDGE_VERSION;
77
+ const d = data;
78
+ if (d?.type !== void 0 && d.type !== "json") return false;
79
+ if (d?.typeUrl !== void 0 && d.typeUrl !== "json") return false;
80
+ const value = d?.value;
81
+ return !!value && typeof value === "object" && !Array.isArray(value) && value.version === BRIDGE_VERSION;
79
82
  }
80
83
  /** Whether the rollup row is a v2 bridge. Rows without `data.value.version == 2` are v1 and keep today's behaviour. */
81
84
  function isBridgeV2(state) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.32.1",
6
+ "version": "1.32.2",
7
7
  "description": "State management utilities for OCAP blockchain",
8
8
  "type": "module",
9
9
  "main": "./lib/index.cjs",
@@ -40,15 +40,15 @@
40
40
  "clean": "rm -rf lib esm"
41
41
  },
42
42
  "dependencies": {
43
- "@arcblock/did": "1.32.1",
44
- "@arcblock/did-util": "1.32.1",
45
- "@arcblock/validator": "1.32.1",
46
- "@ocap/contract": "1.32.1",
47
- "@ocap/mcrypto": "1.32.1",
48
- "@ocap/message": "1.32.1",
49
- "@ocap/types": "1.32.1",
50
- "@ocap/util": "1.32.1",
51
- "@ocap/wallet": "1.32.1",
43
+ "@arcblock/did": "1.32.2",
44
+ "@arcblock/did-util": "1.32.2",
45
+ "@arcblock/validator": "1.32.2",
46
+ "@ocap/contract": "1.32.2",
47
+ "@ocap/mcrypto": "1.32.2",
48
+ "@ocap/message": "1.32.2",
49
+ "@ocap/types": "1.32.2",
50
+ "@ocap/util": "1.32.2",
51
+ "@ocap/wallet": "1.32.2",
52
52
  "bloom-filters": "^1.3.9",
53
53
  "lodash": "^4.17.23"
54
54
  },