|
|
|
@ -767,8 +767,8 @@ func testExternalUI(api *core.SignerAPI) { |
|
|
|
|
data := `{"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Person":[{"name":"name","type":"string"},{"name":"test","type":"uint8"},{"name":"wallet","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person"},{"name":"contents","type":"string"}]},"primaryType":"Mail","domain":{"name":"Ether Mail","version":"1","chainId":"1","verifyingContract":"0xCCCcccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},"message":{"from":{"name":"Cow","test":"3","wallet":"0xcD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},"to":{"name":"Bob","wallet":"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB","test":"2"},"contents":"Hello, Bob!"}}` |
|
|
|
|
//_, err := api.SignData(ctx, accounts.MimetypeTypedData, *addr, hexutil.Encode([]byte(data)))
|
|
|
|
|
var typedData core.TypedData |
|
|
|
|
err := json.Unmarshal([]byte(data), &typedData) |
|
|
|
|
_, err = api.SignTypedData(ctx, *addr, typedData) |
|
|
|
|
json.Unmarshal([]byte(data), &typedData) |
|
|
|
|
_, err := api.SignTypedData(ctx, *addr, typedData) |
|
|
|
|
expectApprove("sign 712 typed data", err) |
|
|
|
|
} |
|
|
|
|
{ // Sign data test - plain text
|
|
|
|
|