From 4d2706c1c5d31688ced802f82fb685ebf3a1c096 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 8 Jan 2025 19:55:02 +0800 Subject: [PATCH] add TODO note about cleaning up template code for return values --- accounts/abi/bind/source2.go.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/accounts/abi/bind/source2.go.tpl b/accounts/abi/bind/source2.go.tpl index e899fac17f..438b2fadd9 100644 --- a/accounts/abi/bind/source2.go.tpl +++ b/accounts/abi/bind/source2.go.tpl @@ -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}}