@ocap/contract 1.17.10 → 1.17.11

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/index.js +6 -0
  2. 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.10",
4
+ "version": "1.17.11",
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.10",
22
- "@ocap/mcrypto": "1.17.10",
23
- "@ocap/util": "1.17.10",
21
+ "@arcblock/did": "1.17.11",
22
+ "@ocap/mcrypto": "1.17.11",
23
+ "@ocap/util": "1.17.11",
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": "062c4f18a4e6d370cb1659980c602e8494969dc3"
70
+ "gitHead": "32ee93b1f1026709bb1b00a58b4b3dc5d551f94a"
71
71
  }