mirror of https://github.com/status-im/web3.js.git
parent
fb34c6c7b9
commit
113a3809ab
|
@ -252,7 +252,7 @@ var formatOutputAddress = function (value) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var dynamicBytesLength = function (type) {
|
var dynamicBytesLength = function (type) {
|
||||||
if (arrayType(type) || prefixedType('string')(type))
|
if (arrayType(type) || type == 'string') // only string itself that is dynamic; stringX is static length.
|
||||||
return ETH_PADDING * 2;
|
return ETH_PADDING * 2;
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
@ -501,6 +501,7 @@ var contract = function (address, desc) {
|
||||||
options.data = signature + parsed;
|
options.data = signature + parsed;
|
||||||
|
|
||||||
var isTransact = result._isTransact === true || (result._isTransact !== false && !method.constant);
|
var isTransact = result._isTransact === true || (result._isTransact !== false && !method.constant);
|
||||||
|
var collapse = options.collapse !== false;
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
result._options = {};
|
result._options = {};
|
||||||
|
@ -518,7 +519,15 @@ var contract = function (address, desc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var output = web3.eth.call(options);
|
var output = web3.eth.call(options);
|
||||||
return outputParser[displayName][typeName](output);
|
var ret = outputParser[displayName][typeName](output);
|
||||||
|
if (collapse)
|
||||||
|
{
|
||||||
|
if (ret.length == 1)
|
||||||
|
ret = ret[0];
|
||||||
|
else if (ret.length == 0)
|
||||||
|
ret = null;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (result[displayName] === undefined) {
|
if (result[displayName] === undefined) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -251,7 +251,7 @@ var formatOutputAddress = function (value) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var dynamicBytesLength = function (type) {
|
var dynamicBytesLength = function (type) {
|
||||||
if (arrayType(type) || prefixedType('string')(type))
|
if (arrayType(type) || type == 'string') // only string itself that is dynamic; stringX is static length.
|
||||||
return ETH_PADDING * 2;
|
return ETH_PADDING * 2;
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -90,6 +90,7 @@ var contract = function (address, desc) {
|
||||||
options.data = signature + parsed;
|
options.data = signature + parsed;
|
||||||
|
|
||||||
var isTransact = result._isTransact === true || (result._isTransact !== false && !method.constant);
|
var isTransact = result._isTransact === true || (result._isTransact !== false && !method.constant);
|
||||||
|
var collapse = options.collapse !== false;
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
result._options = {};
|
result._options = {};
|
||||||
|
@ -107,7 +108,15 @@ var contract = function (address, desc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var output = web3.eth.call(options);
|
var output = web3.eth.call(options);
|
||||||
return outputParser[displayName][typeName](output);
|
var ret = outputParser[displayName][typeName](output);
|
||||||
|
if (collapse)
|
||||||
|
{
|
||||||
|
if (ret.length == 1)
|
||||||
|
ret = ret[0];
|
||||||
|
else if (ret.length == 0)
|
||||||
|
ret = null;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (result[displayName] === undefined) {
|
if (result[displayName] === undefined) {
|
||||||
|
|
Loading…
Reference in New Issue