@ocap/statedb 1.18.31 → 1.18.33

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.
Files changed (2) hide show
  1. package/lib/table.js +7 -0
  2. package/package.json +5 -4
package/lib/table.js CHANGED
@@ -3,6 +3,8 @@ const Kareem = require('kareem');
3
3
  const omit = require('lodash/omit');
4
4
  const pick = require('lodash/pick');
5
5
  const { Ready } = require('@ocap/util/lib/ready');
6
+ const { isValid } = require('@arcblock/did');
7
+ const { toAddress } = require('@ocap/util');
6
8
 
7
9
  class StateDBTable extends Ready {
8
10
  constructor() {
@@ -16,6 +18,11 @@ class StateDBTable extends Ready {
16
18
  ['create', 'get', 'history', 'update', 'reset'].forEach((x) => {
17
19
  Object.defineProperty(this, x, {
18
20
  value: async (...args) => {
21
+ // Ensure the storage layer omits the `did:abt` prefix
22
+ if (typeof args[0] === 'string' && isValid(args[0])) {
23
+ args[0] = toAddress(args[0]);
24
+ }
25
+
19
26
  hooks.execPreSync(x, args);
20
27
  const result = await this[`_${x}`](...args);
21
28
  hooks.execPostSync(x, result);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.18.31",
6
+ "version": "1.18.33",
7
7
  "description": "Defines the basic interface for OCAP StateDB",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -22,10 +22,11 @@
22
22
  "jest": "^27.5.1"
23
23
  },
24
24
  "dependencies": {
25
- "@ocap/state": "1.18.31",
26
- "@ocap/util": "1.18.31",
25
+ "@arcblock/did": "1.18.33",
26
+ "@ocap/state": "1.18.33",
27
+ "@ocap/util": "1.18.33",
27
28
  "kareem": "^2.4.1",
28
29
  "lodash": "^4.17.21"
29
30
  },
30
- "gitHead": "ad152eeee0cdfa5486b50f6151a9a05245804109"
31
+ "gitHead": "0d03089c6651d92a3451e9bbbc865c18c2f5d8ad"
31
32
  }