aboutsummaryrefslogtreecommitdiffstats
path: root/test/abi.parsers.js
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-14 21:06:29 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-14 21:06:29 +0800
commit6b2ec231323b62f5dc81c7702940d784fac98966 (patch)
treee299a7df2f8186c464ea0aed94595710af162b63 /test/abi.parsers.js
parented1cb9edca8fd74dc839377ded77e8c1ed09f648 (diff)
downloaddexon-6b2ec231323b62f5dc81c7702940d784fac98966.tar
dexon-6b2ec231323b62f5dc81c7702940d784fac98966.tar.gz
dexon-6b2ec231323b62f5dc81c7702940d784fac98966.tar.bz2
dexon-6b2ec231323b62f5dc81c7702940d784fac98966.tar.lz
dexon-6b2ec231323b62f5dc81c7702940d784fac98966.tar.xz
dexon-6b2ec231323b62f5dc81c7702940d784fac98966.tar.zst
dexon-6b2ec231323b62f5dc81c7702940d784fac98966.zip
formatting bool tests and fixes
Diffstat (limited to 'test/abi.parsers.js')
-rw-r--r--test/abi.parsers.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/abi.parsers.js b/test/abi.parsers.js
index 6a31c2173..cf6a93fd0 100644
--- a/test/abi.parsers.js
+++ b/test/abi.parsers.js
@@ -127,6 +127,24 @@ describe('abi', function() {
});
+ it('should parse input bool', function() {
+
+ // given
+ var d = clone(description);
+
+ d[0].inputs = [
+ { type: 'bool' }
+ ];
+
+ // when
+ var parser = abi.inputParser(d);
+
+ // then
+ assert.equal(parser.test(true), "0000000000000000000000000000000000000000000000000000000000000001");
+ assert.equal(parser.test(false), "0000000000000000000000000000000000000000000000000000000000000000");
+
+ });
+
it('should parse input hash', function() {
/*
// given
@@ -254,6 +272,25 @@ describe('abi', function() {
assert.equal(parser.test("0x776f726c64000000000000000000000000000000000000000000000000000000")[0], 'world');
});
+
+ it('should parse output bool', function() {
+
+ // given
+ var d = clone(description);
+
+ d[0].outputs = [
+ { type: 'bool' }
+ ];
+
+ // when
+ var parser = abi.outputParser(d);
+
+ // then
+ assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000001")[0], true);
+ assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000000")[0], false);
+
+
+ });
it('should parse multiple output strings', function() {