add TODO note about cleaning up template code for return values

This commit is contained in:
Jared Wasinger 2025-01-08 19:55:02 +08:00 committed by Felix Lange
parent 1b7aecef93
commit 4d2706c1c5

View file

@ -86,6 +86,7 @@ var (
{{.Name}} {{bindtype .Type $structs}}{{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) {
out, err := {{ decapitalise $contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
{{if .Structured}}