@ocap/tx-protocols 1.13.75 → 1.13.76
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/util.js +6 -0
- package/package.json +13 -13
package/lib/util.js
CHANGED
|
@@ -197,6 +197,7 @@ const ensureBlockReward = (rollupState, minReward, txStates) => {
|
|
|
197
197
|
const totalMissingFee = minRequiredReward.sub(totalFixedFee);
|
|
198
198
|
|
|
199
199
|
// 2. calculate actual reward for each dynamic reward tx, mark tx to be updated
|
|
200
|
+
const minTxFee = minRequiredReward.div(new BN(txStates.length));
|
|
200
201
|
const changes = { stake: [], account: [] };
|
|
201
202
|
dynamicFeeTxs.forEach((x) => {
|
|
202
203
|
const maxFee = new BN(x.tx.itxJson.maxFee);
|
|
@@ -220,6 +221,11 @@ const ensureBlockReward = (rollupState, minReward, txStates) => {
|
|
|
220
221
|
throw new Error('NEGATIVE_ACTUAL_FEE', 'Got negative actualFee for tx, abort!');
|
|
221
222
|
}
|
|
222
223
|
|
|
224
|
+
// If the actualFee is less than minTxFee, user will be charged the minTxFee
|
|
225
|
+
if (actualFee.lt(minTxFee)) {
|
|
226
|
+
actualFee = minTxFee;
|
|
227
|
+
}
|
|
228
|
+
|
|
223
229
|
// If the actualFee is less than the maxFee, user will have a refund
|
|
224
230
|
if (actualFee.lt(maxFee)) {
|
|
225
231
|
const refundFee = maxFee.sub(actualFee).toString(10);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.13.
|
|
6
|
+
"version": "1.13.76",
|
|
7
7
|
"description": "Predefined tx pipeline sets to execute certain type of transactions",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@arcblock/did": "1.13.
|
|
23
|
-
"@arcblock/did-util": "1.13.
|
|
24
|
-
"@ocap/asset": "1.13.
|
|
25
|
-
"@ocap/mcrypto": "1.13.
|
|
26
|
-
"@ocap/merkle-tree": "1.13.
|
|
27
|
-
"@ocap/message": "1.13.
|
|
28
|
-
"@ocap/state": "1.13.
|
|
29
|
-
"@ocap/tx-pipeline": "1.13.
|
|
30
|
-
"@ocap/util": "1.13.
|
|
31
|
-
"@ocap/validator": "1.13.
|
|
32
|
-
"@ocap/wallet": "1.13.
|
|
22
|
+
"@arcblock/did": "1.13.76",
|
|
23
|
+
"@arcblock/did-util": "1.13.76",
|
|
24
|
+
"@ocap/asset": "1.13.76",
|
|
25
|
+
"@ocap/mcrypto": "1.13.76",
|
|
26
|
+
"@ocap/merkle-tree": "1.13.76",
|
|
27
|
+
"@ocap/message": "1.13.76",
|
|
28
|
+
"@ocap/state": "1.13.76",
|
|
29
|
+
"@ocap/tx-pipeline": "1.13.76",
|
|
30
|
+
"@ocap/util": "1.13.76",
|
|
31
|
+
"@ocap/validator": "1.13.76",
|
|
32
|
+
"@ocap/wallet": "1.13.76",
|
|
33
33
|
"debug": "^4.3.2",
|
|
34
34
|
"empty-value": "^1.0.1",
|
|
35
35
|
"lodash": "^4.17.21",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"jest": "^27.3.1"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "8787d19bdde22c3085645a38dcaf16a0f5e8c660"
|
|
46
46
|
}
|