mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 15:33:47 +00:00
add TODO note about cleaning up template code for return values
This commit is contained in:
parent
1b7aecef93
commit
4d2706c1c5
1 changed files with 1 additions and 0 deletions
|
|
@ -86,6 +86,7 @@ var (
|
||||||
{{.Name}} {{bindtype .Type $structs}}{{end}}
|
{{.Name}} {{bindtype .Type $structs}}{{end}}
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
// TODO: if return count > 1, we return a struct. no need to iterate .Normalized.Outputs here (but double-check this and remove this TODO once confirmed).
|
||||||
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) ({{if .Structured}} {{.Normalized.Name}}Output,{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) {
|
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) ({{if .Structured}} {{.Normalized.Name}}Output,{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) {
|
||||||
out, err := {{ decapitalise $contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
|
out, err := {{ decapitalise $contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
|
||||||
{{if .Structured}}
|
{{if .Structured}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue