-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
293 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,250 @@ | ||
####################### | ||
# more tests converted from ethabi (rust) | ||
# see https://github.com/rust-ethereum/ethabi/blob/master/ethabi/src/encoder.rs | ||
|
||
# address | ||
- types: ['address'] | ||
args: ['1111111111111111111111111111111111111111'] | ||
data: '0000000000000000000000001111111111111111111111111111111111111111' | ||
|
||
# dynamic array of addresses | ||
- types: ['address[]'] | ||
args: [['1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222']] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222' | ||
|
||
## fixed array of addresses | ||
- types: ['address[2]'] | ||
args: [['1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222']] | ||
data: '0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222' | ||
|
||
## fixed array of dynamic array of addresses | ||
- types: ['address[][2]'] ## note: in solidity arrays are in reverse - double check if ok here!!! | ||
args: [[['1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222'], | ||
['3333333333333333333333333333333333333333', | ||
'4444444444444444444444444444444444444444']]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000040 | ||
00000000000000000000000000000000000000000000000000000000000000a0 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000003333333333333333333333333333333333333333 | ||
0000000000000000000000004444444444444444444444444444444444444444' | ||
|
||
## dynamic array of fixed array of addresses | ||
- types: ['address[2][]'] | ||
args: [[['1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222'], | ||
['3333333333333333333333333333333333333333', | ||
'4444444444444444444444444444444444444444']]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222 | ||
0000000000000000000000003333333333333333333333333333333333333333 | ||
0000000000000000000000004444444444444444444444444444444444444444' | ||
|
||
## dynamic array of dynamic arrays | ||
- types: ['address[][]'] | ||
args: [[['1111111111111111111111111111111111111111'], | ||
['2222222222222222222222222222222222222222']]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000000000000000000000000000000000000000000040 | ||
0000000000000000000000000000000000000000000000000000000000000080 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
0000000000000000000000002222222222222222222222222222222222222222' | ||
|
||
|
||
## fixed array of fixed arrays | ||
- types: ['address[2][2]'] | ||
args: [[['1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222'], | ||
['3333333333333333333333333333333333333333', | ||
'4444444444444444444444444444444444444444']]] | ||
data: '0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222 | ||
0000000000000000000000003333333333333333333333333333333333333333 | ||
0000000000000000000000004444444444444444444444444444444444444444' | ||
|
||
|
||
## fixed array of static tuples followed by dynamic type | ||
- types: ['(uint256,uint256,address)[2]','string'] | ||
args: [[[93523141, 352332135, '4444444444444444444444444444444444444444'], | ||
[12411, 451, '2222222222222222222222222222222222222222']], | ||
'gavofyork'] | ||
data: '0000000000000000000000000000000000000000000000000000000005930cc5 | ||
0000000000000000000000000000000000000000000000000000000015002967 | ||
0000000000000000000000004444444444444444444444444444444444444444 | ||
000000000000000000000000000000000000000000000000000000000000307b | ||
00000000000000000000000000000000000000000000000000000000000001c3 | ||
0000000000000000000000002222222222222222222222222222222222222222 | ||
00000000000000000000000000000000000000000000000000000000000000e0 | ||
0000000000000000000000000000000000000000000000000000000000000009 | ||
6761766f66796f726b0000000000000000000000000000000000000000000000' | ||
|
||
## empty arrays | ||
- types: ['uint256[]','uint256[]'] | ||
args: [[],[]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000040 | ||
0000000000000000000000000000000000000000000000000000000000000060 | ||
0000000000000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000000' | ||
|
||
|
||
## nested empty arrays | ||
- types: ['uint256[][]','uint256[][]'] | ||
args: [[[]],[[]]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000040 | ||
00000000000000000000000000000000000000000000000000000000000000a0 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000000' | ||
|
||
## bool | ||
- types: ['bool'] | ||
args: [true] | ||
data: '0000000000000000000000000000000000000000000000000000000000000001' | ||
|
||
## bool2 | ||
- types: ['bool'] | ||
args: [false] | ||
data: '0000000000000000000000000000000000000000000000000000000000000000' | ||
|
||
|
||
## comprehensive test2 | ||
- types: ['int256','string','int256','int256','int256','int256[]' ] | ||
args: [1, 'gavofyork', 2, 3, 4, [5,6,7]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000001 | ||
00000000000000000000000000000000000000000000000000000000000000c0 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000000000000000000000000000000000000000000003 | ||
0000000000000000000000000000000000000000000000000000000000000004 | ||
0000000000000000000000000000000000000000000000000000000000000100 | ||
0000000000000000000000000000000000000000000000000000000000000009 | ||
6761766f66796f726b0000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000003 | ||
0000000000000000000000000000000000000000000000000000000000000005 | ||
0000000000000000000000000000000000000000000000000000000000000006 | ||
0000000000000000000000000000000000000000000000000000000000000007' | ||
|
||
|
||
## static tuple of addresses | ||
- types: ['(address,address)'] | ||
args: [['1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222']] | ||
data: '0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222' | ||
|
||
## dynamic tuple | ||
- types: ['(string,string)'] | ||
args: [['gavofyork', 'gavofyork']] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000040 | ||
0000000000000000000000000000000000000000000000000000000000000080 | ||
0000000000000000000000000000000000000000000000000000000000000009 | ||
6761766f66796f726b0000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000009 | ||
6761766f66796f726b0000000000000000000000000000000000000000000000' | ||
|
||
|
||
## complex tuple | ||
- types: ['(uint256,string,address,address)'] | ||
args: [[0x1111111111111111111111111111111111111111111111111111111111111111, | ||
'gavofyork', | ||
'1111111111111111111111111111111111111111', | ||
'2222222222222222222222222222222222222222']] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
1111111111111111111111111111111111111111111111111111111111111111 | ||
0000000000000000000000000000000000000000000000000000000000000080 | ||
0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222 | ||
0000000000000000000000000000000000000000000000000000000000000009 | ||
6761766f66796f726b0000000000000000000000000000000000000000000000' | ||
|
||
|
||
# nested tuple | ||
- types: ['(string,bool,string,(string,string,(string,string)))'] | ||
args: [['test', true, 'cyborg', | ||
['night', 'day', ['weee', 'funtests']]]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000080 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
00000000000000000000000000000000000000000000000000000000000000c0 | ||
0000000000000000000000000000000000000000000000000000000000000100 | ||
0000000000000000000000000000000000000000000000000000000000000004 | ||
7465737400000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000006 | ||
6379626f72670000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000060 | ||
00000000000000000000000000000000000000000000000000000000000000a0 | ||
00000000000000000000000000000000000000000000000000000000000000e0 | ||
0000000000000000000000000000000000000000000000000000000000000005 | ||
6e69676874000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000003 | ||
6461790000000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000040 | ||
0000000000000000000000000000000000000000000000000000000000000080 | ||
0000000000000000000000000000000000000000000000000000000000000004 | ||
7765656500000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000008 | ||
66756e7465737473000000000000000000000000000000000000000000000000' | ||
|
||
|
||
# params containing dynamic tuple | ||
- types: ['address', '(bool,string,string)', 'address', 'address', 'bool' ] | ||
args: ['2222222222222222222222222222222222222222', | ||
[true, 'spaceship', 'cyborg'], | ||
'3333333333333333333333333333333333333333', | ||
'4444444444444444444444444444444444444444', | ||
false] | ||
data: '0000000000000000000000002222222222222222222222222222222222222222 | ||
00000000000000000000000000000000000000000000000000000000000000a0 | ||
0000000000000000000000003333333333333333333333333333333333333333 | ||
0000000000000000000000004444444444444444444444444444444444444444 | ||
0000000000000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
0000000000000000000000000000000000000000000000000000000000000060 | ||
00000000000000000000000000000000000000000000000000000000000000a0 | ||
0000000000000000000000000000000000000000000000000000000000000009 | ||
7370616365736869700000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000006 | ||
6379626f72670000000000000000000000000000000000000000000000000000' | ||
|
||
|
||
# params containing static tuple | ||
- types: ['address', '(address,bool,bool)', 'address', 'address'] | ||
args: ['1111111111111111111111111111111111111111', | ||
['2222222222222222222222222222222222222222', true, false], | ||
'3333333333333333333333333333333333333333', | ||
'4444444444444444444444444444444444444444'] | ||
data: '0000000000000000000000001111111111111111111111111111111111111111 | ||
0000000000000000000000002222222222222222222222222222222222222222 | ||
0000000000000000000000000000000000000000000000000000000000000001 | ||
0000000000000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000003333333333333333333333333333333333333333 | ||
0000000000000000000000004444444444444444444444444444444444444444' | ||
|
||
# dynamic tuple with nested static tuples | ||
- types: ['(((bool,uint256)),uint256[]))'] | ||
args: [[[[false,0x777]],[0x42,0x1337]]] | ||
data: '0000000000000000000000000000000000000000000000000000000000000020 | ||
0000000000000000000000000000000000000000000000000000000000000000 | ||
0000000000000000000000000000000000000000000000000000000000000777 | ||
0000000000000000000000000000000000000000000000000000000000000060 | ||
0000000000000000000000000000000000000000000000000000000000000002 | ||
0000000000000000000000000000000000000000000000000000000000000042 | ||
0000000000000000000000000000000000000000000000000000000000001337' |