forked from cerc-io/plugeth
accounts/abi/bind: fix duplicate field names in the generated go struct (#24924)
* accounts/abi/bind: fix duplicate field names in the generated go struct #24627 * accounts, cmd/abigen: resolve name conflicts * ci lint, accounts/abi: remove unused function overloadedArgName Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This commit is contained in:
+5
-1
@@ -198,7 +198,11 @@ func abigen(c *cli.Context) error {
|
||||
nameParts := strings.Split(name, ":")
|
||||
types = append(types, nameParts[len(nameParts)-1])
|
||||
|
||||
libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36]
|
||||
// Derive the library placeholder which is a 34 character prefix of the
|
||||
// hex encoding of the keccak256 hash of the fully qualified library name.
|
||||
// Note that the fully qualified library name is the path of its source
|
||||
// file and the library name separated by ":".
|
||||
libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36] // the first 2 chars are 0x
|
||||
libs[libPattern] = nameParts[len(nameParts)-1]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user