Comparing version 7.1.6 to 8.0.0
@@ -26,4 +26,5 @@ 'use strict'; | ||
ref_block_prefix: 452435776, | ||
context_free_cpu_bandwidth: 0, | ||
packed_bandwidth_words: 0, | ||
max_net_usage_words: 0, | ||
max_kcpu_usage: 0, | ||
delay_sec: 0, | ||
context_free_actions: [] | ||
@@ -61,8 +62,9 @@ }; | ||
assert.deepEqual({ | ||
expiration: trx.transaction.data.expiration, | ||
expiration: trx.transaction.transaction.expiration, | ||
region: 0, | ||
ref_block_num: trx.transaction.data.ref_block_num, | ||
ref_block_prefix: trx.transaction.data.ref_block_prefix, | ||
context_free_cpu_bandwidth: 0, | ||
packed_bandwidth_words: 0, | ||
ref_block_num: trx.transaction.transaction.ref_block_num, | ||
ref_block_prefix: trx.transaction.transaction.ref_block_prefix, | ||
max_net_usage_words: 0, | ||
max_kcpu_usage: 0, | ||
delay_sec: 0, | ||
context_free_actions: [] | ||
@@ -232,3 +234,3 @@ }, headers); | ||
var ans = [{ actor: 'inita', permission: 'owner' }, { actor: 'initb', permission: 'owner' }]; | ||
assert.deepEqual(transaction.data.actions[0].authorization, ans); | ||
assert.deepEqual(transaction.transaction.actions[0].authorization, ans); | ||
}); | ||
@@ -272,6 +274,6 @@ }); | ||
.then(function (tr) { | ||
assert.equal(1, tr.transaction.data.actions.length); | ||
assert.equal(1, tr.transaction.transaction.actions.length); | ||
return contract.transfer('initb', 'inita', '1 CUR', '').then(function (tr) { | ||
assert.equal(1, tr.transaction.data.actions.length); | ||
assert.equal(1, tr.transaction.transaction.actions.length); | ||
}); | ||
@@ -300,3 +302,3 @@ }); | ||
assertTr = function assertTr(tr) { | ||
assert.equal(2, tr.transaction.data.actions.length); | ||
assert.equal(2, tr.transaction.transaction.actions.length); | ||
}; | ||
@@ -362,3 +364,3 @@ | ||
}).then(function (tr) { | ||
assert.equal(2, tr.transaction.data.actions.length); | ||
assert.equal(2, tr.transaction.transaction.actions.length); | ||
}); | ||
@@ -450,3 +452,3 @@ }); | ||
assert.equal(tx.transaction.data.actions[0].account, 'currency'); | ||
assert.equal(tx.transaction.transaction.actions[0].account, 'currency'); | ||
@@ -453,0 +455,0 @@ case 5: |
@@ -124,4 +124,4 @@ 'use strict'; | ||
assert.equal(tx.transaction.data.actions[0].account, 'eosio'); | ||
assert.equal(tx.transaction.data.actions[1].account, 'currency'); | ||
assert.equal(tx.transaction.transaction.actions[0].account, 'eosio'); | ||
assert.equal(tx.transaction.transaction.actions[1].account, 'currency'); | ||
@@ -128,0 +128,0 @@ case 7: |
@@ -40,3 +40,2 @@ 'use strict'; | ||
} | ||
if (reserveFunctions.has(type)) { | ||
@@ -610,15 +609,2 @@ throw new TypeError('Conflicting Api function: ' + type); | ||
if (txObject.packed_bandwidth_words === 0 || txObject.packed_bandwidth_words == null) { | ||
var txBandwidth = Object.assign({}, txObject); | ||
// do not include context-free data | ||
txBandwidth.context_free_actions = []; | ||
var size = Fcbuffer.toBuffer(Transaction, txBandwidth).length; | ||
// +2 extra bytes for uint16 packed_bandwidth_words | ||
// number of 8 byte words this transaction can compress into | ||
txObject.packed_bandwidth_words = Math.ceil((size + 2) / 8); // compression = none | ||
} | ||
// console.log('txObject', JSON.stringify(txObject,null,4)) | ||
@@ -657,3 +643,3 @@ | ||
compression: 'none', | ||
data: tr, | ||
transaction: tr, | ||
signatures: sigs | ||
@@ -660,0 +646,0 @@ }; |
{ | ||
"name": "eosjs", | ||
"version": "7.1.6", | ||
"version": "8.0.0", | ||
"description": "General purpose library for the EOS blockchain.", | ||
@@ -48,6 +48,6 @@ "main": "lib/index.js", | ||
"create-hash": "^1.1.3", | ||
"eosjs-api": "^4.0.2", | ||
"eosjs-api": "^4.0.3", | ||
"eosjs-ecc": "^3.0.2", | ||
"eosjs-json": "^3.0.2", | ||
"fcbuffer": "^2.1.4" | ||
"eosjs-json": "^4.0.1", | ||
"fcbuffer": "^2.1.5" | ||
}, | ||
@@ -54,0 +54,0 @@ "babel": { |
@@ -14,3 +14,3 @@ [](https://travis-ci.org/EOSIO/eosjs) | ||
| --- | --- | --- | --- | --- | --- | | ||
| dawn3 | branch: master | `npm install eosjs@dawn3` | branch: master | eosio/eos:20180328 | [local docker](https://github.com/EOSIO/eosjs/tree/master/docker) | | ||
| dawn3 | branch: master | `npm install eosjs@dawn3` | branch: master | eosio/eos:dawn3x | [local docker](https://github.com/EOSIO/eosjs/tree/master/docker) | | ||
| dawn2 | branch: dawn2 | `npm install eosjs` | branch: dawn-2.x | eosio/eos:dawn2x | http or [https://t1readonly.eos.io](https://t1readonly.eos.io/v1/chain/get_info) | | ||
@@ -346,3 +346,3 @@ | ||
eos.contract('currency', (error, c) => currency = c) | ||
issue = {to: 'inita', quantity: '1.0000 CUR'} | ||
issue = {to: 'inita', quantity: '1.0000 CUR', memo: 'memo'} | ||
issueBuffer = currency.fc.toBuffer('issue', issue) | ||
@@ -396,3 +396,3 @@ assert.deepEqual(issue, eos.fc.fromBuffer('issue', issueBuffer)) | ||
npm install | ||
npm run build | ||
npm run build_browser | ||
# builds: ./dist/eos.js | ||
@@ -399,0 +399,0 @@ ``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
33613
1290146
- Removedeosjs-json@3.0.2(transitive)
Updatedeosjs-api@^4.0.3
Updatedeosjs-json@^4.0.1
Updatedfcbuffer@^2.1.5