mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
tests for parsing output array
This commit is contained in:
parent
1e2c1ae98a
commit
823fb2995b
1 changed files with 27 additions and 0 deletions
|
|
@ -716,6 +716,33 @@ describe('abi', function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should parse output array', function () {
|
||||||
|
|
||||||
|
// given
|
||||||
|
var d = clone(description);
|
||||||
|
d[0].outputs = [
|
||||||
|
{ type: 'int[]' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// when
|
||||||
|
var parser = abi.outputParser(d);
|
||||||
|
|
||||||
|
// then
|
||||||
|
assert.equal(parser.test("0x" +
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000002" +
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000005" +
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000006")[0][0],
|
||||||
|
5
|
||||||
|
);
|
||||||
|
assert.equal(parser.test("0x" +
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000002" +
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000005" +
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000006")[0][1],
|
||||||
|
6
|
||||||
|
);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue