mirror of https://github.com/status-im/web3.js.git
Merge branch 'master' into develop
Conflicts: dist/web3-light.min.js dist/web3.min.js
This commit is contained in:
commit
92e2a2f6a5
|
@ -577,7 +577,7 @@ SolidityParam.prototype.combine = function (param) {
|
|||
* @returns {Boolean}
|
||||
*/
|
||||
SolidityParam.prototype.isDynamic = function () {
|
||||
return this.value.length > 64;
|
||||
return this.value.length > 64 || this.offset !== undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -693,7 +693,7 @@ SolidityParam.decodeBytes = function (bytes, index) {
|
|||
var offset = getOffset(bytes, index);
|
||||
|
||||
// 2 * , cause we also parse length
|
||||
return new SolidityParam(bytes.substr(offset * 2, 2 * 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, 2 * 64), 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -708,7 +708,7 @@ SolidityParam.decodeArray = function (bytes, index) {
|
|||
index = index || 0;
|
||||
var offset = getOffset(bytes, index);
|
||||
var length = parseInt('0x' + bytes.substr(offset * 2, 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64), 0);
|
||||
};
|
||||
|
||||
module.exports = SolidityParam;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -577,7 +577,7 @@ SolidityParam.prototype.combine = function (param) {
|
|||
* @returns {Boolean}
|
||||
*/
|
||||
SolidityParam.prototype.isDynamic = function () {
|
||||
return this.value.length > 64;
|
||||
return this.value.length > 64 || this.offset !== undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -693,7 +693,7 @@ SolidityParam.decodeBytes = function (bytes, index) {
|
|||
var offset = getOffset(bytes, index);
|
||||
|
||||
// 2 * , cause we also parse length
|
||||
return new SolidityParam(bytes.substr(offset * 2, 2 * 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, 2 * 64), 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -708,7 +708,7 @@ SolidityParam.decodeArray = function (bytes, index) {
|
|||
index = index || 0;
|
||||
var offset = getOffset(bytes, index);
|
||||
var length = parseInt('0x' + bytes.substr(offset * 2, 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64), 0);
|
||||
};
|
||||
|
||||
module.exports = SolidityParam;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -72,7 +72,7 @@ SolidityParam.prototype.combine = function (param) {
|
|||
* @returns {Boolean}
|
||||
*/
|
||||
SolidityParam.prototype.isDynamic = function () {
|
||||
return this.value.length > 64;
|
||||
return this.value.length > 64 || this.offset !== undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -188,7 +188,7 @@ SolidityParam.decodeBytes = function (bytes, index) {
|
|||
var offset = getOffset(bytes, index);
|
||||
|
||||
// 2 * , cause we also parse length
|
||||
return new SolidityParam(bytes.substr(offset * 2, 2 * 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, 2 * 64), 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@ SolidityParam.decodeArray = function (bytes, index) {
|
|||
index = index || 0;
|
||||
var offset = getOffset(bytes, index);
|
||||
var length = parseInt('0x' + bytes.substr(offset * 2, 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));
|
||||
return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64), 0);
|
||||
};
|
||||
|
||||
module.exports = SolidityParam;
|
||||
|
|
|
@ -24,6 +24,8 @@ describe('lib/solidity/coder', function () {
|
|||
test({ type: 'bytes', expected: 'gavofyork', value: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'int[]', expected: [], value: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'int[]', expected: [new bn(3)], value: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
|
|
|
@ -24,6 +24,8 @@ describe('lib/solidity/coder', function () {
|
|||
test({ type: 'bytes', value: 'gavofyork', expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'int[]', value: [], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'int[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
|
|
Loading…
Reference in New Issue