From 0f0f7b364fcda76c52b9d94dde17cf8c80e45453 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 3 May 2023 19:18:43 +0300 Subject: [PATCH] rpcbinding: use typed return err value in etTypeConverter Otherwise the resulting code can't be compiled. Signed-off-by: Anna Shaleva --- cli/smartcontract/testdata/structs/rpcbindings.out | 4 ++-- cli/smartcontract/testdata/types/rpcbindings.out | 2 +- pkg/smartcontract/rpcbinding/binding.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/smartcontract/testdata/structs/rpcbindings.out b/cli/smartcontract/testdata/structs/rpcbindings.out index 039b15e7e..8b165ec20 100644 --- a/cli/smartcontract/testdata/structs/rpcbindings.out +++ b/cli/smartcontract/testdata/structs/rpcbindings.out @@ -709,7 +709,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { } index++ - res.Value, err = arr[index].Value(), nil + res.Value, err = arr[index].Value(), error(nil) if err != nil { return fmt.Errorf("field Value: %w", err) } @@ -1193,7 +1193,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Extra, err = arr[index].Value(), nil + res.Extra, err = arr[index].Value(), error(nil) if err != nil { return fmt.Errorf("field Extra: %w", err) } diff --git a/cli/smartcontract/testdata/types/rpcbindings.out b/cli/smartcontract/testdata/types/rpcbindings.out index e6a14ecea..94bf63910 100644 --- a/cli/smartcontract/testdata/types/rpcbindings.out +++ b/cli/smartcontract/testdata/types/rpcbindings.out @@ -96,7 +96,7 @@ func (c *ContractReader) Any(a any) (any, error) { if err != nil { return nil, err } - return item.Value(), nil + return item.Value(), error(nil) } (unwrap.Item(c.invoker.Call(Hash, "any", a))) } diff --git a/pkg/smartcontract/rpcbinding/binding.go b/pkg/smartcontract/rpcbinding/binding.go index 310cee233..6443f5c64 100644 --- a/pkg/smartcontract/rpcbinding/binding.go +++ b/pkg/smartcontract/rpcbinding/binding.go @@ -412,7 +412,7 @@ func extendedTypeToGo(et binding.ExtendedType, named map[string]binding.Extended func etTypeConverter(et binding.ExtendedType, v string) string { switch et.Base { case smartcontract.AnyType: - return v + ".Value(), nil" + return v + ".Value(), error(nil)" case smartcontract.BoolType: return v + ".TryBool()" case smartcontract.IntegerType: