Skip to content

Commit ebf46d0

Browse files
committed
Unit tests fixes after go-ethereum v1.10.1 update
Const in abi.Method has been removed to Constant. Error ABI need to declare a type of Error function.
1 parent 2b3a0c8 commit ebf46d0

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

pkg/chain/ethereum/ethutil/error_resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// neither encoded strictly as method calls nor strictly as return values, nor
1616
// strictly as events, but some various bits of it are used for unpacking the
1717
// errors. See ResolveError below.
18-
const errorABIString = "[{\"constant\":true,\"outputs\":[{\"type\":\"string\"}],\"inputs\":[{\"name\":\"message\", \"type\":\"string\"}],\"name\":\"Error\"}]"
18+
const errorABIString = "[{\"constant\":true,\"outputs\":[{\"type\":\"string\"}],\"inputs\":[{\"name\":\"message\", \"type\":\"string\"}],\"name\":\"Error\", \"type\": \"function\"}]"
1919

2020
var errorABI abi.ABI
2121

pkg/chain/ethereum/ethutil/error_resolver_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717

1818
var testABIMethods = map[string]abi.Method{
1919
"Test": abi.Method{
20-
Const: false,
21-
Name: "Test",
22-
Inputs: []abi.Argument{},
23-
Outputs: []abi.Argument{},
20+
Constant: false,
21+
Name: "Test",
22+
Inputs: []abi.Argument{},
23+
Outputs: []abi.Argument{},
2424
},
2525
}
2626
var testABI = abi.ABI{

tools/generators/ethlike/contract_parsing_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ func TestMethodStability(t *testing.T) {
118118
allMethods := make(map[string]abi.Method)
119119
allMethods["boop"] = abi.Method{Name: "boop", RawName: "boop"}
120120
allMethods["boop0"] = abi.Method{Name: "boop0", RawName: "boop"}
121-
allMethods["bap"] = abi.Method{Name: "bap", RawName: "bap", Const: true}
121+
allMethods["bap"] = abi.Method{Name: "bap", RawName: "bap", Constant: true}
122122
allMethods["sap"] = abi.Method{Name: "sap", RawName: "sap"}
123-
allMethods["map"] = abi.Method{Name: "map", RawName: "map", Const: true}
123+
allMethods["map"] = abi.Method{Name: "map", RawName: "map", Constant: true}
124124
allMethods["map0"] = abi.Method{Name: "map0", RawName: "map"}
125125

126126
payableMethods := make(map[string]struct{})

0 commit comments

Comments
 (0)