diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-15 03:29:20 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-15 03:29:20 +0800 |
commit | 603c790213e7e14ad9cf51e2e170af59144f783b (patch) | |
tree | 35e36a7e58456c70a16dd477f5539bc8921a65b6 /lib/abi.js | |
parent | b0a9bbf33a022a5763e62a78dbd7f32af250726c (diff) | |
download | dexon-603c790213e7e14ad9cf51e2e170af59144f783b.tar dexon-603c790213e7e14ad9cf51e2e170af59144f783b.tar.gz dexon-603c790213e7e14ad9cf51e2e170af59144f783b.tar.bz2 dexon-603c790213e7e14ad9cf51e2e170af59144f783b.tar.lz dexon-603c790213e7e14ad9cf51e2e170af59144f783b.tar.xz dexon-603c790213e7e14ad9cf51e2e170af59144f783b.tar.zst dexon-603c790213e7e14ad9cf51e2e170af59144f783b.zip |
next part of abi.js parsers tests and fixes
Diffstat (limited to 'lib/abi.js')
-rw-r--r-- | lib/abi.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/abi.js b/lib/abi.js index 674ad8288..e147a3504 100644 --- a/lib/abi.js +++ b/lib/abi.js @@ -110,7 +110,7 @@ var setupInputTypes = function () { { type: prefixedType('string'), format: formatString }, { type: prefixedType('real'), format: formatInt }, { type: prefixedType('ureal'), format: formatInt }, - { type: namedType('address') }, + { type: namedType('address'), format: formatInt }, { type: namedType('bool'), format: formatBool } ]; }; @@ -172,6 +172,10 @@ var setupOutputTypes = function () { return web3.toAscii(value); }; + var formatAddress = function (value) { + return "0x" + value.slice(value.length - 40, value.length); + }; + return [ { type: prefixedType('uint'), format: formatInt }, { type: prefixedType('int'), format: formatInt }, @@ -179,7 +183,7 @@ var setupOutputTypes = function () { { type: prefixedType('string'), format: formatString }, { type: prefixedType('real'), format: formatInt }, { type: prefixedType('ureal'), format: formatInt }, - { type: namedType('address') }, + { type: namedType('address'), format: formatAddress }, { type: namedType('bool'), format: formatBool } ]; }; |