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:
lwh
2022-06-07 08:38:54 +02:00
committed by GitHub
co-authored by Gary Rong
parent d9566e39bd
commit 84b327244d
8 changed files with 136 additions and 44 deletions
+5 -1
View File
@@ -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]
}
}