mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 19:48:13 +00:00
more encoding tests passing
This commit is contained in:
parent
cf4817e785
commit
6d3542315f
@ -95,52 +95,52 @@ describe('lib/solidity/coder', function () {
|
||||
//expected: '731a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b'});
|
||||
//test({ type: 'bytes32', value: '0x02838654a83c213dae3698391eabbd54a5b6e1fb3452bc7fa4ea0dd5c8ce7e29',
|
||||
//expected: '02838654a83c213dae3698391eabbd54a5b6e1fb3452bc7fa4ea0dd5c8ce7e29'});
|
||||
//test({ type: 'bytes', value: '0x6761766f66796f726b',
|
||||
//expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
//'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'bytes', value: '0x731a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b',
|
||||
//expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'731a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b'});
|
||||
//test({ type: 'string', value: 'gavofyork', expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
//'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'bytes', value: '0xc3a40000c3a4',
|
||||
//expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000006' +
|
||||
//'c3a40000c3a40000000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'bytes', value: '0x6761766f66796f726b',
|
||||
expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'bytes', value: '0x731a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b',
|
||||
expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'731a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b'});
|
||||
test({ type: 'string', value: 'gavofyork', expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'bytes', value: '0xc3a40000c3a4',
|
||||
expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000006' +
|
||||
'c3a40000c3a40000000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'bytes32', value: '0xc3a40000c3a4',
|
||||
//expected: 'c3a40000c3a40000000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'bytes64', value: '0xc3a40000c3a40000000000000000000000000000000000000000000000000000' +
|
||||
//'c3a40000c3a40000000000000000000000000000000000000000000000000000',
|
||||
//expected: 'c3a40000c3a40000000000000000000000000000000000000000000000000000' +
|
||||
//'c3a40000c3a40000000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'string', value: 'ää',
|
||||
//expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000008' +
|
||||
//'c383c2a4c383c2a4000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'string', value: 'ü',
|
||||
//expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000002' +
|
||||
//'c3bc000000000000000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'string', value: 'Ã',
|
||||
//expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000002' +
|
||||
//'c383000000000000000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'int[]', value: [], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000000'});
|
||||
//test({ type: 'int[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
//test({ type: 'int256[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
//test({ type: 'int[]', value: [1,2,3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000003' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000002' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
test({ type: 'string', value: 'ää',
|
||||
expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000008' +
|
||||
'c383c2a4c383c2a4000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'string', value: 'ü',
|
||||
expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000002' +
|
||||
'c3bc000000000000000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'string', value: 'Ã',
|
||||
expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000002' +
|
||||
'c383000000000000000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'int[]', value: [], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000000'});
|
||||
test({ type: 'int[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
test({ type: 'int256[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
test({ type: 'int[]', value: [1,2,3], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000003' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000001' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000002' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000003'});
|
||||
|
||||
|
||||
|
||||
@ -235,9 +235,9 @@ describe('lib/solidity/coder', function () {
|
||||
//test({ types: ['bytes32'], values: ['0x6761766f66796f726b'],
|
||||
//test({ types: ['bytes32'], values: ['0x6761766f66796f726b'],
|
||||
//expected: '6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
//test({ types: ['string'], values: ['gavofyork'], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
//'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
//'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
test({ types: ['string'], values: ['gavofyork'], expected: '0000000000000000000000000000000000000000000000000000000000000020' +
|
||||
'0000000000000000000000000000000000000000000000000000000000000009' +
|
||||
'6761766f66796f726b0000000000000000000000000000000000000000000000'});
|
||||
|
||||
//test({ types: ['bytes32', 'int'], values: ['0x6761766f66796f726b', 5],
|
||||
//expected: '6761766f66796f726b0000000000000000000000000000000000000000000000' +
|
||||
|
Loading…
x
Reference in New Issue
Block a user