@ocap/state 1.17.22 → 1.18.0

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/states/tx.js +4 -3
  2. package/package.json +8 -8
package/lib/states/tx.js CHANGED
@@ -5,7 +5,7 @@ const groupBy = require('lodash/groupBy');
5
5
  const upperFirst = require('lodash/upperFirst');
6
6
  const camelCase = require('lodash/camelCase');
7
7
  const { fromTypeUrl, formatMessage, decodeAny } = require('@ocap/message');
8
- const { toBase64, BN } = require('@ocap/util');
8
+ const { toBase64, BN, isBN } = require('@ocap/util');
9
9
  const { getListField } = require('@ocap/util/lib/get-list-field');
10
10
 
11
11
  const ZERO = new BN(0);
@@ -387,7 +387,7 @@ const getTxReceipts = ({ tx, code }, ctx = {}) => {
387
387
  };
388
388
 
389
389
  const create = (context, code = 'OK') => {
390
- const { txHash, txTime, tx, itxExtras = {} } = context;
390
+ const { txHash, txTime, tx, totalGas, itxExtras = {} } = context;
391
391
  const itx = decodeAny(tx.itx).value; // we should decode here because `context.itx` maybe changed
392
392
  const typeUrl = fromTypeUrl(tx.itx.typeUrl);
393
393
  const typeName = tx.itx.typeUrl.split(':').pop();
@@ -407,7 +407,8 @@ const create = (context, code = 'OK') => {
407
407
  delegator: tx.delegator,
408
408
  from: tx.from,
409
409
  nonce: tx.nonce,
410
- serviceFee: tx.serviceFee,
410
+ serviceFee: tx.serviceFee || '0',
411
+ gasFee: isBN(totalGas) ? totalGas.toString(10) : '0',
411
412
  pk: toBase64(tx.pk),
412
413
  signature: toBase64(tx.signature),
413
414
  signatures: getListField(tx, 'signatures').map((x) => formatMessage('Multisig', x)),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.22",
6
+ "version": "1.18.0",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -16,12 +16,12 @@
16
16
  "coverage": "npm run test -- --coverage"
17
17
  },
18
18
  "dependencies": {
19
- "@arcblock/did": "1.17.22",
20
- "@arcblock/validator": "1.17.22",
21
- "@ocap/contract": "1.17.22",
22
- "@ocap/mcrypto": "1.17.22",
23
- "@ocap/message": "1.17.22",
24
- "@ocap/util": "1.17.22",
19
+ "@arcblock/did": "1.18.0",
20
+ "@arcblock/validator": "1.18.0",
21
+ "@ocap/contract": "1.18.0",
22
+ "@ocap/mcrypto": "1.18.0",
23
+ "@ocap/message": "1.18.0",
24
+ "@ocap/util": "1.18.0",
25
25
  "bloom-filters": "^1.3.9",
26
26
  "lodash": "^4.17.21"
27
27
  },
@@ -31,5 +31,5 @@
31
31
  "keywords": [],
32
32
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
33
33
  "license": "MIT",
34
- "gitHead": "f6cd2a2ca2a417081d0be22f86547195b0e2bc14"
34
+ "gitHead": "c48f928ee4f0deddf0f5e4bcb82fd6ffd7f2bc99"
35
35
  }