accounts/abi: Gary's review feedback

This commit is contained in:
Guillaume Ballet 2019-07-05 11:04:41 +02:00
parent 1ee8697904
commit b7fb49c624
2 changed files with 3 additions and 3 deletions

View file

@ -25,13 +25,13 @@ import (
"errors" "errors"
"fmt" "fmt"
"go/format" "go/format"
"log"
"regexp" "regexp"
"strings" "strings"
"text/template" "text/template"
"unicode" "unicode"
"github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/log"
) )
// Lang is a target programming language selector to generate bindings for. // Lang is a target programming language selector to generate bindings for.
@ -153,7 +153,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
for pattern, name := range libs { for pattern, name := range libs {
matched, err := regexp.Match("__\\$"+pattern+"\\$__", []byte(contracts[types[i]].InputBin)) matched, err := regexp.Match("__\\$"+pattern+"\\$__", []byte(contracts[types[i]].InputBin))
if err != nil { if err != nil {
log.Fatalf("Could not search for pattern %v in %v: %v", pattern, contracts[types[i]], err) log.Error("Could not search for pattern", "pattern", pattern, "contract", contracts[types[i]], "err", err)
} }
if matched { if matched {
contracts[types[i]].Libraries[pattern] = name contracts[types[i]].Libraries[pattern] = name

View file

@ -82,7 +82,7 @@ func main() {
bins []string bins []string
types []string types []string
sigs []map[string]string sigs []map[string]string
libs map[string]string libs = make(map[string]string)
) )
if *solFlag != "" || *vyFlag != "" || *abiFlag == "-" { if *solFlag != "" || *vyFlag != "" || *abiFlag == "-" {
// Generate the list of types to exclude from binding // Generate the list of types to exclude from binding