mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
Temporarily switched to using common.Address in tests
This commit is contained in:
parent
5f23386d76
commit
e6bca17014
2 changed files with 8 additions and 8 deletions
|
|
@ -61,7 +61,7 @@ type EIP712Domain struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
ChainId *big.Int `json:"chainId"`
|
ChainId *big.Int `json:"chainId"`
|
||||||
VerifyingContract string `json:"verifyingContract"`
|
VerifyingContract common.Address `json:"verifyingContract"`
|
||||||
Salt hexutil.Bytes `json:"salt"`
|
Salt hexutil.Bytes `json:"salt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,14 +358,14 @@ func (typedData *TypedData) EncodeData(primaryType string, data map[string]inter
|
||||||
|
|
||||||
switch encType {
|
switch encType {
|
||||||
case "address":
|
case "address":
|
||||||
primitiveEncType = "address"
|
primitiveEncType = "uint160"
|
||||||
bytesValue := []byte{}
|
bytesValue := []byte{}
|
||||||
for i := 0; i < 12; i++ {
|
for i := 0; i < 12; i++ {
|
||||||
bytesValue = append(bytesValue, 0)
|
bytesValue = append(bytesValue, 0)
|
||||||
}
|
}
|
||||||
foo := common.BytesToAddress([]byte(encValue.(string)))
|
//foo := common.BytesToAddress([]byte(encValue.(string)))
|
||||||
fmt.Println(foo)
|
//fmt.Println(foo)
|
||||||
for _, _byte := range common.BytesToAddress([]byte(encValue.(string))) {
|
for _, _byte := range encValue.(common.Address) {
|
||||||
bytesValue = append(bytesValue, _byte)
|
bytesValue = append(bytesValue, _byte)
|
||||||
}
|
}
|
||||||
primitiveEncValue = bytesValue
|
primitiveEncValue = bytesValue
|
||||||
|
|
|
||||||
|
|
@ -76,18 +76,18 @@ var domainStandard = EIP712Domain{
|
||||||
"Ether Mail",
|
"Ether Mail",
|
||||||
"1",
|
"1",
|
||||||
big.NewInt(1),
|
big.NewInt(1),
|
||||||
"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
|
common.HexToAddress("0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"),
|
||||||
nil,
|
nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
var dataStandard = map[string]interface{}{
|
var dataStandard = map[string]interface{}{
|
||||||
"from": map[string]interface{}{
|
"from": map[string]interface{}{
|
||||||
"name": "Cow",
|
"name": "Cow",
|
||||||
"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
|
"wallet": common.HexToAddress("0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"),
|
||||||
},
|
},
|
||||||
"to": map[string]interface{}{
|
"to": map[string]interface{}{
|
||||||
"name": "Bob",
|
"name": "Bob",
|
||||||
"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB",
|
"wallet": common.HexToAddress("0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"),
|
||||||
},
|
},
|
||||||
"contents": "Hello, Bob!",
|
"contents": "Hello, Bob!",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue