mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 06:23:47 +00:00
accounts/abi: hex-ify the tests made for this branch.
Signed-off-by: RJ Catalano <rj@monax.io>
This commit is contained in:
parent
9bb7fd7bd2
commit
ef94e2c4a0
1 changed files with 19 additions and 19 deletions
|
|
@ -239,63 +239,63 @@ func TestArraysAndSlicesUnpack(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
`[ { "type": "uint8[]" } ]`,
|
`[ { "type": "uint8[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]uint8{1, 2},
|
[]uint8{1, 2},
|
||||||
[]uint8{},
|
[]uint8{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint8[2]" } ]`,
|
`[ { "type": "uint8[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]uint8{1, 2},
|
[2]uint8{1, 2},
|
||||||
[2]uint8{},
|
[2]uint8{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint16[]" } ]`,
|
`[ { "type": "uint16[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]uint16{1, 2},
|
[]uint16{1, 2},
|
||||||
[]uint16{},
|
[]uint16{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint16[2]" } ]`,
|
`[ { "type": "uint16[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]uint16{1, 2},
|
[2]uint16{1, 2},
|
||||||
[2]uint16{},
|
[2]uint16{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint32[]" } ]`,
|
`[ { "type": "uint32[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]uint32{1, 2},
|
[]uint32{1, 2},
|
||||||
[]uint32{},
|
[]uint32{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint32[2]" } ]`,
|
`[ { "type": "uint32[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]uint32{1, 2},
|
[2]uint32{1, 2},
|
||||||
[2]uint32{},
|
[2]uint32{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint64[]" } ]`,
|
`[ { "type": "uint64[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]uint64{1, 2},
|
[]uint64{1, 2},
|
||||||
[]uint64{},
|
[]uint64{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint64[2]" } ]`,
|
`[ { "type": "uint64[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]uint64{1, 2},
|
[2]uint64{1, 2},
|
||||||
[2]uint64{},
|
[2]uint64{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "uint256[]" } ]`,
|
`[ { "type": "uint256[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]*big.Int{big.NewInt(1), big.NewInt(2)},
|
[]*big.Int{big.NewInt(1), big.NewInt(2)},
|
||||||
[]*big.Int{},
|
[]*big.Int{},
|
||||||
"",
|
"",
|
||||||
|
|
@ -309,70 +309,70 @@ func TestArraysAndSlicesUnpack(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int8[]" } ]`,
|
`[ { "type": "int8[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]int8{1, 2},
|
[]int8{1, 2},
|
||||||
[]int8{},
|
[]int8{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int8[2]" } ]`,
|
`[ { "type": "int8[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]int8{1, 2},
|
[2]int8{1, 2},
|
||||||
[2]int8{},
|
[2]int8{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int16[]" } ]`,
|
`[ { "type": "int16[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]int16{1, 2},
|
[]int16{1, 2},
|
||||||
[]int16{},
|
[]int16{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int16[2]" } ]`,
|
`[ { "type": "int16[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]int16{1, 2},
|
[2]int16{1, 2},
|
||||||
[2]int16{},
|
[2]int16{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int32[]" } ]`,
|
`[ { "type": "int32[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]int32{1, 2},
|
[]int32{1, 2},
|
||||||
[]int32{},
|
[]int32{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int32[2]" } ]`,
|
`[ { "type": "int32[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]int32{1, 2},
|
[2]int32{1, 2},
|
||||||
[2]int32{},
|
[2]int32{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int64[]" } ]`,
|
`[ { "type": "int64[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]int64{1, 2},
|
[]int64{1, 2},
|
||||||
[]int64{},
|
[]int64{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int64[2]" } ]`,
|
`[ { "type": "int64[2]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), pad([]byte{2}, 32, true)...),
|
common.Hex2Bytes("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[2]int64{1, 2},
|
[2]int64{1, 2},
|
||||||
[2]int64{},
|
[2]int64{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int256[]" } ]`,
|
`[ { "type": "int256[]" } ]`,
|
||||||
append(pad(common.Hex2Bytes("20"), 32, true), formatSliceOutput([]byte{1}, []byte{2})...),
|
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002"),
|
||||||
[]*big.Int{big.NewInt(1), big.NewInt(2)},
|
[]*big.Int{big.NewInt(1), big.NewInt(2)},
|
||||||
[]*big.Int{},
|
[]*big.Int{},
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
`[ { "type": "int256[3]" } ]`,
|
`[ { "type": "int256[3]" } ]`,
|
||||||
append(pad([]byte{1}, 32, true), append(pad([]byte{2}, 32, true), pad([]byte{3}, 32, true)...)...),
|
common.Hex2Bytes("000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003"),
|
||||||
[3]*big.Int{big.NewInt(1), big.NewInt(2), big.NewInt(3)},
|
[3]*big.Int{big.NewInt(1), big.NewInt(2), big.NewInt(3)},
|
||||||
[3]*big.Int{},
|
[3]*big.Int{},
|
||||||
"",
|
"",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue