diff options
author | Guillaume Ballet <gballet@gmail.com> | 2019-07-08 16:27:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-08 16:27:05 +0800 |
commit | 5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6 (patch) | |
tree | e42faceb46789ffe57e23ac8623b1f7a4adf2633 /cmd | |
parent | f2eb3b1c56a2b745a100760e5fabb78e339cb4cf (diff) | |
download | go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.tar go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.tar.gz go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.tar.bz2 go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.tar.lz go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.tar.xz go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.tar.zst go-tangerine-5bc9ccfa0af6e2892c1f40689dfb90a056ba81d6.zip |
accounts/abi/bind: link dependent libs in deploy (#19718)
* accounts, abigen: link dependent libs in deploy
* abigen: add java generation
* bind: Fix unit tests
* abigen: add unit test
* Fix CI
* Post-rebase fixes
* Fix rebase issue
* accounts/abi: Gary's review feedback
* accounts/abi: More Gary feedback
* accounts/abi: minor fixes
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/abigen/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index f9e048623..aaf2f9fa8 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common/compiler" + "github.com/ethereum/go-ethereum/crypto" ) var ( @@ -81,6 +82,7 @@ func main() { bins []string types []string sigs []map[string]string + libs = make(map[string]string) ) if *solFlag != "" || *vyFlag != "" || *abiFlag == "-" { // Generate the list of types to exclude from binding @@ -128,6 +130,9 @@ func main() { nameParts := strings.Split(name, ":") types = append(types, nameParts[len(nameParts)-1]) + + libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36] + libs[libPattern] = nameParts[len(nameParts)-1] } } else { // Otherwise load up the ABI, optional bytecode and type name from the parameters @@ -155,7 +160,7 @@ func main() { types = append(types, kind) } // Generate the contract binding - code, err := bind.Bind(types, abis, bins, sigs, *pkgFlag, lang) + code, err := bind.Bind(types, abis, bins, sigs, *pkgFlag, lang, libs) if err != nil { fmt.Printf("Failed to generate ABI binding: %v\n", err) os.Exit(-1) |