Comparing version 14.0.0 to 14.1.0
@@ -386,3 +386,5 @@ 'use strict'; | ||
network.getInfo({}).then(function (info) { | ||
assert.equal(info.chain_id, chainId, 'chainId mismatch, signatures will not match transaction authority'); | ||
if (info.chain_id !== chainId) { | ||
console.warn('WARN: chainId mismatch, signatures will not match transaction authority. ' + ('expected ' + chainId + ' !== actual ' + info.chain_id)); | ||
} | ||
}).catch(function (error) { | ||
@@ -389,0 +391,0 @@ console.error(error); |
@@ -141,3 +141,3 @@ 'use strict'; | ||
it('deploy ' + contract + '@' + account, function _callee3() { | ||
var config, eos, wasm, abi; | ||
var config, eos, wasm, abi, code, diskAbi; | ||
return regeneratorRuntime.async(function _callee3$(_context3) { | ||
@@ -153,7 +153,2 @@ while (1) { | ||
abi = fs.readFileSync('docker/contracts/' + contract + '/' + contract + '.abi'); | ||
// When ran multiple times, deploying to the same account | ||
// avoids a same contract version deploy error. | ||
// TODO: undeploy contract instead | ||
_context3.next = 7; | ||
@@ -167,2 +162,17 @@ return regeneratorRuntime.awrap(eos.setcode(account, 0, 0, wasm)); | ||
case 9: | ||
_context3.next = 11; | ||
return regeneratorRuntime.awrap(eos.getCode(account)); | ||
case 11: | ||
code = _context3.sent; | ||
diskAbi = JSON.parse(abi); | ||
delete diskAbi.____comment; | ||
if (!diskAbi.error_messages) { | ||
diskAbi.error_messages = []; | ||
} | ||
assert.deepEqual(diskAbi, code.abi); | ||
case 16: | ||
case 'end': | ||
@@ -175,2 +185,7 @@ return _context3.stop(); | ||
} | ||
// When ran multiple times, deploying to the same account | ||
// avoids a same contract version deploy error. | ||
// TODO: undeploy contract instead (when API allows this) | ||
deploy('eosio.msig'); | ||
@@ -177,0 +192,0 @@ deploy('eosio.token'); |
@@ -5,5 +5,2 @@ 'use strict'; | ||
// change "bytes" to "abi_def" | ||
schema.setabi.fields.abi = 'abi_def'; | ||
module.exports = schema; |
@@ -84,3 +84,3 @@ 'use strict'; | ||
var override = Object.assign({}, authorityOverride, abiOverride, wasmCodeOverride(config), actionDataOverride(structLookup, forceActionDataHex), config.override); | ||
var override = Object.assign({}, authorityOverride, abiOverride(structLookup), wasmCodeOverride(config), actionDataOverride(structLookup, forceActionDataHex), config.override); | ||
@@ -595,11 +595,24 @@ var _config = config, | ||
var abiOverride = { | ||
'abi.fromObject': function abiFromObject(value) { | ||
if (typeof value === 'string') { | ||
return JSON.parse(value); | ||
var abiOverride = function abiOverride(structLookup) { | ||
return { | ||
'abi.fromObject': function abiFromObject(value) { | ||
if (typeof value === 'string') { | ||
return JSON.parse(value); | ||
} | ||
if (Buffer.isBuffer(value)) { | ||
return JSON.parse(value.toString()); | ||
} | ||
}, | ||
'setabi.abi.appendByteBuffer': function setabiAbiAppendByteBuffer(_ref) { | ||
var fields = _ref.fields, | ||
object = _ref.object, | ||
b = _ref.b; | ||
var ser = structLookup('abi_def', 'eosio'); | ||
var b2 = new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY, ByteBuffer.LITTLE_ENDIAN); | ||
ser.appendByteBuffer(b2, object.abi); | ||
b.writeVarint32(b2.offset); // length prefix | ||
b.append(b2.copy(0, b2.offset), 'binary'); | ||
} | ||
if (Buffer.isBuffer(value)) { | ||
return JSON.parse(value.toString()); | ||
} | ||
} | ||
}; | ||
}; | ||
@@ -609,5 +622,5 @@ | ||
return { | ||
'setcode.code.fromObject': function setcodeCodeFromObject(_ref) { | ||
var object = _ref.object, | ||
result = _ref.result; | ||
'setcode.code.fromObject': function setcodeCodeFromObject(_ref2) { | ||
var object = _ref2.object, | ||
result = _ref2.result; | ||
@@ -641,7 +654,7 @@ try { | ||
return { | ||
'action.data.fromByteBuffer': function actionDataFromByteBuffer(_ref2) { | ||
var fields = _ref2.fields, | ||
object = _ref2.object, | ||
b = _ref2.b, | ||
config = _ref2.config; | ||
'action.data.fromByteBuffer': function actionDataFromByteBuffer(_ref3) { | ||
var fields = _ref3.fields, | ||
object = _ref3.object, | ||
b = _ref3.b, | ||
config = _ref3.config; | ||
@@ -661,6 +674,6 @@ var ser = (object.name || '') == '' ? fields.data : structLookup(object.name, object.account); | ||
'action.data.appendByteBuffer': function actionDataAppendByteBuffer(_ref3) { | ||
var fields = _ref3.fields, | ||
object = _ref3.object, | ||
b = _ref3.b; | ||
'action.data.appendByteBuffer': function actionDataAppendByteBuffer(_ref4) { | ||
var fields = _ref4.fields, | ||
object = _ref4.object, | ||
b = _ref4.b; | ||
@@ -684,6 +697,6 @@ var ser = (object.name || '') == '' ? fields.data : structLookup(object.name, object.account); | ||
'action.data.fromObject': function actionDataFromObject(_ref4) { | ||
var fields = _ref4.fields, | ||
object = _ref4.object, | ||
result = _ref4.result; | ||
'action.data.fromObject': function actionDataFromObject(_ref5) { | ||
var fields = _ref5.fields, | ||
object = _ref5.object, | ||
result = _ref5.result; | ||
var data = object.data, | ||
@@ -708,11 +721,11 @@ name = object.name; | ||
'action.data.toObject': function actionDataToObject(_ref5) { | ||
var fields = _ref5.fields, | ||
object = _ref5.object, | ||
result = _ref5.result, | ||
config = _ref5.config; | ||
'action.data.toObject': function actionDataToObject(_ref6) { | ||
var fields = _ref6.fields, | ||
object = _ref6.object, | ||
result = _ref6.result, | ||
config = _ref6.config; | ||
var _ref6 = object || {}, | ||
data = _ref6.data, | ||
name = _ref6.name; | ||
var _ref7 = object || {}, | ||
data = _ref7.data, | ||
name = _ref7.name; | ||
@@ -719,0 +732,0 @@ var ser = (name || '') == '' ? fields.data : structLookup(name, object.account); |
{ | ||
"name": "eosjs", | ||
"version": "14.0.0", | ||
"version": "14.1.0", | ||
"description": "General purpose library for the EOS blockchain.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -6,3 +6,3 @@ [](https://travis-ci.org/EOSIO/eosjs) | ||
| --- | --- | --- | --- | | ||
| tag: 14.x.x | `npm install eosjs` (version 14) | tag: v1.0.0 | eosio/eos:v1.0.0 | | ||
| tag: 14.x.x | `npm install eosjs` (version 14) | tag: v1.0.1 | eosio/eos:v1.0.1 | | ||
| tag: 13.x.x | `npm install eosjs` (version 13) | tag: dawn-v4.2.0 | eosio/eos:20180526 | | ||
@@ -9,0 +9,0 @@ | tag: 12.x.x | `npm install eosjs` (version 12) | tag: dawn-v4.1.0 | eosio/eos:20180519 | |
35846
1364301
28