@ocap/contract 1.17.10 → 1.17.13
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/index.js +6 -0
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -151,6 +151,12 @@ const validate = (compiled, quota, ensureZeroSum = false) => {
|
|
|
151
151
|
throw new Error('no contract calls to validate');
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
// Since QLDB's max batch size is 40, each contract call will update 1 account
|
|
155
|
+
// We need to set a smaller hard limit to avoid QLDB errors
|
|
156
|
+
if (compiled.length > 30) {
|
|
157
|
+
throw new Error('too much contract calls found, max is 15');
|
|
158
|
+
}
|
|
159
|
+
|
|
154
160
|
// to track consumption
|
|
155
161
|
let remaining = new BN(quota ? quota.value : '0');
|
|
156
162
|
const tokenRemaining = Object.keys(quota && quota.tokens ? quota.tokens : {}).reduce((acc, x) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/contract",
|
|
3
3
|
"description": "Utility to compile/validate and run ocap contract",
|
|
4
|
-
"version": "1.17.
|
|
4
|
+
"version": "1.17.13",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "wangshijun",
|
|
7
7
|
"email": "shijun@arcblock.io",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"wangshijun <shijun@arcblock.io> (https://github.com/wangshijun)"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/did": "1.17.
|
|
22
|
-
"@ocap/mcrypto": "1.17.
|
|
23
|
-
"@ocap/util": "1.17.
|
|
21
|
+
"@arcblock/did": "1.17.13",
|
|
22
|
+
"@ocap/mcrypto": "1.17.13",
|
|
23
|
+
"@ocap/util": "1.17.13",
|
|
24
24
|
"debug": "^4.3.4",
|
|
25
25
|
"esprima": "^4.0.1",
|
|
26
26
|
"lodash": "^4.17.21"
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"test": "jest --forceExit --detectOpenHandles",
|
|
68
68
|
"coverage": "yarn test -- --coverage"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "e355828a8ff11d95c162205246a9f0e1c9ab782d"
|
|
71
71
|
}
|