Skip to content

Commit e534690

Browse files
committed
move recursive bytes type encoding test to signed_data_test.go
1 parent a38f103 commit e534690

File tree

2 files changed

+46
-60
lines changed

2 files changed

+46
-60
lines changed

signer/core/signed_data_recursive_array_test.go

Lines changed: 0 additions & 60 deletions
This file was deleted.

signer/core/signed_data_test.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,3 +1014,49 @@ func TestComplexTypedDataWithLowercaseReftype(t *testing.T) {
10141014
t.Fatalf("Error, got %x, wanted %x", sighash, expSigHash)
10151015
}
10161016
}
1017+
1018+
var recursiveBytesTypesStandard = apitypes.Types{
1019+
"EIP712Domain": {
1020+
{
1021+
Name: "name",
1022+
Type: "string",
1023+
},
1024+
{
1025+
Name: "version",
1026+
Type: "string",
1027+
},
1028+
{
1029+
Name: "chainId",
1030+
Type: "uint256",
1031+
},
1032+
{
1033+
Name: "verifyingContract",
1034+
Type: "address",
1035+
},
1036+
},
1037+
"Val": {
1038+
{
1039+
Name: "field",
1040+
Type: "bytes[][]",
1041+
},
1042+
},
1043+
}
1044+
1045+
var recursiveBytesMessageStandard = map[string]interface{}{
1046+
"field": [][][]byte{{{1}, {2}}, {{3}, {4}}},
1047+
}
1048+
1049+
var recursiveBytesTypedData = apitypes.TypedData{
1050+
Types: recursiveBytesTypesStandard,
1051+
PrimaryType: "Val",
1052+
Domain: domainStandard,
1053+
Message: recursiveBytesMessageStandard,
1054+
}
1055+
1056+
func TestEncodeDataRecursiveBytes(t *testing.T) {
1057+
typedData := recursiveBytesTypedData
1058+
_, err := typedData.EncodeData(typedData.PrimaryType, typedData.Message, 0)
1059+
if err != nil {
1060+
t.Fatalf("got err %v", err)
1061+
}
1062+
}

0 commit comments

Comments
 (0)