@ocap/statedb 1.18.32 → 1.18.34
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/lib/table.js +7 -0
- 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.
|
|
6
|
+
"version": "1.18.34",
|
|
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
|
-
"@
|
|
26
|
-
"@ocap/
|
|
25
|
+
"@arcblock/did": "1.18.34",
|
|
26
|
+
"@ocap/state": "1.18.34",
|
|
27
|
+
"@ocap/util": "1.18.34",
|
|
27
28
|
"kareem": "^2.4.1",
|
|
28
29
|
"lodash": "^4.17.21"
|
|
29
30
|
},
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "c12d3cbf9617d861d83c08726d9e0d55fdf9a459"
|
|
31
32
|
}
|