diff --git a/signer/core/signed_data_recursive_array_test.go b/signer/core/signed_data_recursive_array_test.go deleted file mode 100644 index cbbdea2b49..0000000000 --- a/signer/core/signed_data_recursive_array_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package core - -import ( - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/signer/core/apitypes" - "testing" -) - -var typesStandard = apitypes.Types{ - "EIP712Domain": { - { - Name: "name", - Type: "string", - }, - { - Name: "version", - Type: "string", - }, - { - Name: "chainId", - Type: "uint256", - }, - { - Name: "verifyingContract", - Type: "address", - }, - }, - "Val": { - { - Name: "field", - Type: "bytes[][]", - }, - }, -} - -var messageStandard = map[string]interface{}{ - "field": [][][]byte{{{1}, {2}}, {{3}, {4}}}, -} - -var domainStandard = apitypes.TypedDataDomain{ - Name: "Recursive Bytes", - Version: "1", - ChainId: math.NewHexOrDecimal256(1), - VerifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - Salt: "", -} - -var typedData = apitypes.TypedData{ - Types: typesStandard, - PrimaryType: "Val", - Domain: domainStandard, - Message: messageStandard, -} - -func TestEncodeDataRecursiveBytes(t *testing.T) { - _, err := typedData.EncodeData(typedData.PrimaryType, typedData.Message, 0) - if err != nil { - t.Fatalf("got err %v", err) - } -} diff --git a/signer/core/signed_data_test.go b/signer/core/signed_data_test.go index d0637010ba..b6c080736c 100644 --- a/signer/core/signed_data_test.go +++ b/signer/core/signed_data_test.go @@ -1014,3 +1014,49 @@ func TestComplexTypedDataWithLowercaseReftype(t *testing.T) { t.Fatalf("Error, got %x, wanted %x", sighash, expSigHash) } } + +var recursiveBytesTypesStandard = apitypes.Types{ + "EIP712Domain": { + { + Name: "name", + Type: "string", + }, + { + Name: "version", + Type: "string", + }, + { + Name: "chainId", + Type: "uint256", + }, + { + Name: "verifyingContract", + Type: "address", + }, + }, + "Val": { + { + Name: "field", + Type: "bytes[][]", + }, + }, +} + +var recursiveBytesMessageStandard = map[string]interface{}{ + "field": [][][]byte{{{1}, {2}}, {{3}, {4}}}, +} + +var recursiveBytesTypedData = apitypes.TypedData{ + Types: recursiveBytesTypesStandard, + PrimaryType: "Val", + Domain: domainStandard, + Message: recursiveBytesMessageStandard, +} + +func TestEncodeDataRecursiveBytes(t *testing.T) { + typedData := recursiveBytesTypedData + _, err := typedData.EncodeData(typedData.PrimaryType, typedData.Message, 0) + if err != nil { + t.Fatalf("got err %v", err) + } +}