mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-01 17:43:45 +00:00
accounts/abi/abigen: add panic when encoding constructor input fails
This commit is contained in:
parent
1be2215a35
commit
1013c1c25b
1 changed files with 5 additions and 2 deletions
|
|
@ -71,8 +71,11 @@ var (
|
|||
|
||||
{{ if .Constructor.Inputs }}
|
||||
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) PackConstructor({{range .Constructor.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) []byte {
|
||||
res, _ := {{ decapitalise $contract.Type}}.abi.Pack("" {{range .Constructor.Inputs}}, {{.Name}}{{end}})
|
||||
return res
|
||||
enc, err := {{ decapitalise $contract.Type}}.abi.Pack("" {{range .Constructor.Inputs}}, {{.Name}}{{end}})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return enc
|
||||
}
|
||||
{{ end -}}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue