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
0484d96325
commit
e92a59b875
2 changed files with 8 additions and 8 deletions
|
|
@ -61,7 +61,7 @@ type EIP712Domain struct {
|
|||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
ChainId *big.Int `json:"chainId"`
|
||||
VerifyingContract string `json:"verifyingContract"`
|
||||
VerifyingContract common.Address `json:"verifyingContract"`
|
||||
Salt hexutil.Bytes `json:"salt"`
|
||||
}
|
||||
|
||||
|
|
@ -358,14 +358,14 @@ func (typedData *TypedData) EncodeData(primaryType string, data map[string]inter
|
|||
|
||||
switch encType {
|
||||
case "address":
|
||||
primitiveEncType = "address"
|
||||
primitiveEncType = "uint160"
|
||||
bytesValue := []byte{}
|
||||
for i := 0; i < 12; i++ {
|
||||
bytesValue = append(bytesValue, 0)
|
||||
}
|
||||
foo := common.BytesToAddress([]byte(encValue.(string)))
|
||||
fmt.Println(foo)
|
||||
for _, _byte := range common.BytesToAddress([]byte(encValue.(string))) {
|
||||
//foo := common.BytesToAddress([]byte(encValue.(string)))
|
||||
//fmt.Println(foo)
|
||||
for _, _byte := range encValue.(common.Address) {
|
||||
bytesValue = append(bytesValue, _byte)
|
||||
}
|
||||
primitiveEncValue = bytesValue
|
||||
|
|
|
|||
|
|
@ -76,18 +76,18 @@ var domainStandard = EIP712Domain{
|
|||
"Ether Mail",
|
||||
"1",
|
||||
big.NewInt(1),
|
||||
"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
|
||||
common.HexToAddress("0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"),
|
||||
nil,
|
||||
}
|
||||
|
||||
var dataStandard = map[string]interface{}{
|
||||
"from": map[string]interface{}{
|
||||
"name": "Cow",
|
||||
"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
|
||||
"wallet": common.HexToAddress("0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"),
|
||||
},
|
||||
"to": map[string]interface{}{
|
||||
"name": "Bob",
|
||||
"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB",
|
||||
"wallet": common.HexToAddress("0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"),
|
||||
},
|
||||
"contents": "Hello, Bob!",
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue