diff options
author | Gav Wood <i@gavwood.com> | 2015-01-12 00:54:36 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-01-12 00:54:36 +0800 |
commit | ded221fba2cc21e1037a1130d9d142e657a52e89 (patch) | |
tree | 48d0c2871eafec7049d0f5c04b24db8d0f91df3f /lib | |
parent | 47687cf085196e2e4fa7ec42ff426f241dae10c5 (diff) | |
download | go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.tar go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.tar.gz go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.tar.bz2 go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.tar.lz go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.tar.xz go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.tar.zst go-tangerine-ded221fba2cc21e1037a1130d9d142e657a52e89.zip |
Merge commit 'ab745d3b0eb89d67db1ed953020c665be3d072ed' into develop
Conflicts:
libjsqrc/ethereumjs/.travis.yml
libjsqrc/ethereumjs/README.md
libjsqrc/ethereumjs/dist/ethereum.js
libjsqrc/ethereumjs/dist/ethereum.js.map
libjsqrc/ethereumjs/lib/abi.js
libjsqrc/ethereumjs/package.json
Diffstat (limited to 'lib')
-rw-r--r-- | lib/abi.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/abi.js b/lib/abi.js index 99d2ba932..217006fb7 100644 --- a/lib/abi.js +++ b/lib/abi.js @@ -92,6 +92,12 @@ var setupInputTypes = function () { } var padding = calcPadding(type, expected); + if (padding > 32) + return false; // not allowed to be so big. + padding = 32; // override as per the new ABI. + + if (prefix === "string") + return web3.fromAscii(value, padding).substr(2); if (typeof value === "number") value = value.toString(16); else if (typeof value === "string") @@ -110,6 +116,8 @@ var setupInputTypes = function () { return false; } + padding = 32; //override as per the new ABI. + return padLeft(formatter ? formatter(value) : value, padding * 2); }; }; @@ -165,12 +173,16 @@ var setupOutputTypes = function () { } var padding = calcPadding(type, expected); + if (padding > 32) + return -1; // not allowed to be so big. + padding = 32; // override as per the new ABI. return padding * 2; }; }; var namedType = function (name, padding) { return function (type) { + padding = 32; // override as per the new ABI. return name === type ? padding * 2 : -1; }; }; |