go-ethereum
go-ethereum copied to clipboard
abi.Method.Sig not contains return types
System information
Geth version: geth version 1.10.21
OS & Version: OSX
Commit hash : (if develop)
Expected behaviour
See document of abi.Method. The field Sig is a string of the function signature. For a function foo(uint32 a, int b) returns (uint), it will return foo(uint32,int256) instead of foo(uint32,int256)(uint256)
Actual behaviour
retrun foo(uint32,int256)(uint256) in the previous case.
Steps to reproduce the behaviour
Backtrace
[backtrace]
When submitting logs: please submit them as text and not screenshots.
// Sig returns the methods string signature according to the ABI spec.
// e.g. function foo(uint32 a, int b) = "foo(uint32,int256)"
// Please note that "int" is substitute for its canonical representation "int256"
Sig [string](https://pkg.go.dev/builtin#string)
// ID returns the canonical representation of the method's signature used by the
// abi definition to identify method names and types.
ID [][byte](https://pkg.go.dev/builtin#byte)
Originally, I think the idea was that hash(Sig) -> 4-byte abi (ID). The return parameter does not affect the abi identifier, so hence it was not included in the Sig. The two are tied to one another.
I think that was an explicit decision and not a bug. Question is if it's something we want to change. Personally I'm leaning towards "not", for now.
I'm also leaning towards not changing it, since I bet people are depending on the property that hash(Sig) gives the 4 byte abi