From 8ae4a1e957a17087a3d28b7270561971d4566263 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 30 May 2023 17:34:51 +0300 Subject: [PATCH] rpcbinding: adjust comment of `FromStackItem` template methods Signed-off-by: Anna Shaleva --- cli/smartcontract/testdata/nameservice/nns.go | 8 ++--- cli/smartcontract/testdata/nex/nex.go | 4 +-- .../testdata/notifications/rpcbindings.out | 28 ++++++++--------- .../notifications/rpcbindings_extended.out | 30 +++++++++---------- .../notifications/rpcbindings_guessed.out | 30 +++++++++---------- .../testdata/structs/rpcbindings.out | 30 +++++++++---------- .../testdata/verifyrpc/verify.go | 4 +-- pkg/smartcontract/rpcbinding/binding.go | 6 ++-- 8 files changed, 70 insertions(+), 70 deletions(-) diff --git a/cli/smartcontract/testdata/nameservice/nns.go b/cli/smartcontract/testdata/nameservice/nns.go index 076aaa438..82cc8374d 100644 --- a/cli/smartcontract/testdata/nameservice/nns.go +++ b/cli/smartcontract/testdata/nameservice/nns.go @@ -363,8 +363,8 @@ func SetAdminEventsFromApplicationLog(log *result.ApplicationLog) ([]*SetAdminEv return res, nil } -// FromStackItem converts provided stackitem.Array to SetAdminEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SetAdminEvent or +// returns an error if it's not possible to do to so. func (e *SetAdminEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -456,8 +456,8 @@ func RenewEventsFromApplicationLog(log *result.ApplicationLog) ([]*RenewEvent, e return res, nil } -// FromStackItem converts provided stackitem.Array to RenewEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to RenewEvent or +// returns an error if it's not possible to do to so. func (e *RenewEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") diff --git a/cli/smartcontract/testdata/nex/nex.go b/cli/smartcontract/testdata/nex/nex.go index ac530f79c..0d716adde 100644 --- a/cli/smartcontract/testdata/nex/nex.go +++ b/cli/smartcontract/testdata/nex/nex.go @@ -267,8 +267,8 @@ func OnMintEventsFromApplicationLog(log *result.ApplicationLog) ([]*OnMintEvent, return res, nil } -// FromStackItem converts provided stackitem.Array to OnMintEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to OnMintEvent or +// returns an error if it's not possible to do to so. func (e *OnMintEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") diff --git a/cli/smartcontract/testdata/notifications/rpcbindings.out b/cli/smartcontract/testdata/notifications/rpcbindings.out index 4b95b5a65..1e873d611 100644 --- a/cli/smartcontract/testdata/notifications/rpcbindings.out +++ b/cli/smartcontract/testdata/notifications/rpcbindings.out @@ -216,7 +216,7 @@ func itemToLedgerBlock(item stackitem.Item, err error) (*LedgerBlock, error) { } // FromStackItem retrieves fields of LedgerBlock from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -338,7 +338,7 @@ func itemToLedgerBlockSR(item stackitem.Item, err error) (*LedgerBlockSR, error) } // FromStackItem retrieves fields of LedgerBlockSR from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -476,7 +476,7 @@ func itemToLedgerTransaction(item stackitem.Item, err error) (*LedgerTransaction } // FromStackItem retrieves fields of LedgerTransaction from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -572,7 +572,7 @@ func itemToLedgerTransactionSigner(item stackitem.Item, err error) (*LedgerTrans } // FromStackItem retrieves fields of LedgerTransactionSigner from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -699,7 +699,7 @@ func itemToLedgerWitnessCondition(item stackitem.Item, err error) (*LedgerWitnes } // FromStackItem retrieves fields of LedgerWitnessCondition from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -739,7 +739,7 @@ func itemToLedgerWitnessRule(item stackitem.Item, err error) (*LedgerWitnessRule } // FromStackItem retrieves fields of LedgerWitnessRule from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -793,8 +793,8 @@ func ComplicatedNameEventsFromApplicationLog(log *result.ApplicationLog) ([]*Com return res, nil } -// FromStackItem converts provided stackitem.Array to ComplicatedNameEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to ComplicatedNameEvent or +// returns an error if it's not possible to do to so. func (e *ComplicatedNameEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -854,8 +854,8 @@ func SomeMapEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeMapEven return res, nil } -// FromStackItem converts provided stackitem.Array to SomeMapEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeMapEvent or +// returns an error if it's not possible to do to so. func (e *SomeMapEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -924,8 +924,8 @@ func SomeStructEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeStru return res, nil } -// FromStackItem converts provided stackitem.Array to SomeStructEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeStructEvent or +// returns an error if it's not possible to do to so. func (e *SomeStructEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -989,8 +989,8 @@ func SomeArrayEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeArray return res, nil } -// FromStackItem converts provided stackitem.Array to SomeArrayEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeArrayEvent or +// returns an error if it's not possible to do to so. func (e *SomeArrayEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") diff --git a/cli/smartcontract/testdata/notifications/rpcbindings_extended.out b/cli/smartcontract/testdata/notifications/rpcbindings_extended.out index 9b269e2eb..3b2ab5c07 100755 --- a/cli/smartcontract/testdata/notifications/rpcbindings_extended.out +++ b/cli/smartcontract/testdata/notifications/rpcbindings_extended.out @@ -222,7 +222,7 @@ func itemToCrazyStruct(item stackitem.Item, err error) (*CrazyStruct, error) { } // FromStackItem retrieves fields of CrazyStruct from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *CrazyStruct) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -262,7 +262,7 @@ func itemToLedgerBlock(item stackitem.Item, err error) (*LedgerBlock, error) { } // FromStackItem retrieves fields of LedgerBlock from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -384,7 +384,7 @@ func itemToLedgerBlockSR(item stackitem.Item, err error) (*LedgerBlockSR, error) } // FromStackItem retrieves fields of LedgerBlockSR from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -522,7 +522,7 @@ func itemToLedgerTransaction(item stackitem.Item, err error) (*LedgerTransaction } // FromStackItem retrieves fields of LedgerTransaction from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -618,7 +618,7 @@ func itemToLedgerTransactionSigner(item stackitem.Item, err error) (*LedgerTrans } // FromStackItem retrieves fields of LedgerTransactionSigner from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -745,7 +745,7 @@ func itemToLedgerWitnessCondition(item stackitem.Item, err error) (*LedgerWitnes } // FromStackItem retrieves fields of LedgerWitnessCondition from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -785,7 +785,7 @@ func itemToLedgerWitnessRule(item stackitem.Item, err error) (*LedgerWitnessRule } // FromStackItem retrieves fields of LedgerWitnessRule from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -839,8 +839,8 @@ func ComplicatedNameEventsFromApplicationLog(log *result.ApplicationLog) ([]*Com return res, nil } -// FromStackItem converts provided stackitem.Array to ComplicatedNameEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to ComplicatedNameEvent or +// returns an error if it's not possible to do to so. func (e *ComplicatedNameEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -900,8 +900,8 @@ func SomeMapEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeMapEven return res, nil } -// FromStackItem converts provided stackitem.Array to SomeMapEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeMapEvent or +// returns an error if it's not possible to do to so. func (e *SomeMapEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -1020,8 +1020,8 @@ func SomeStructEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeStru return res, nil } -// FromStackItem converts provided stackitem.Array to SomeStructEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeStructEvent or +// returns an error if it's not possible to do to so. func (e *SomeStructEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -1072,8 +1072,8 @@ func SomeArrayEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeArray return res, nil } -// FromStackItem converts provided stackitem.Array to SomeArrayEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeArrayEvent or +// returns an error if it's not possible to do to so. func (e *SomeArrayEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") diff --git a/cli/smartcontract/testdata/notifications/rpcbindings_guessed.out b/cli/smartcontract/testdata/notifications/rpcbindings_guessed.out index 0fba2708c..5b4d429c1 100755 --- a/cli/smartcontract/testdata/notifications/rpcbindings_guessed.out +++ b/cli/smartcontract/testdata/notifications/rpcbindings_guessed.out @@ -222,7 +222,7 @@ func itemToLedgerBlock(item stackitem.Item, err error) (*LedgerBlock, error) { } // FromStackItem retrieves fields of LedgerBlock from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -344,7 +344,7 @@ func itemToLedgerBlockSR(item stackitem.Item, err error) (*LedgerBlockSR, error) } // FromStackItem retrieves fields of LedgerBlockSR from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -482,7 +482,7 @@ func itemToLedgerTransaction(item stackitem.Item, err error) (*LedgerTransaction } // FromStackItem retrieves fields of LedgerTransaction from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -578,7 +578,7 @@ func itemToLedgerTransactionSigner(item stackitem.Item, err error) (*LedgerTrans } // FromStackItem retrieves fields of LedgerTransactionSigner from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -705,7 +705,7 @@ func itemToLedgerWitnessCondition(item stackitem.Item, err error) (*LedgerWitnes } // FromStackItem retrieves fields of LedgerWitnessCondition from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -745,7 +745,7 @@ func itemToLedgerWitnessRule(item stackitem.Item, err error) (*LedgerWitnessRule } // FromStackItem retrieves fields of LedgerWitnessRule from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -785,7 +785,7 @@ func itemToUnnamed(item stackitem.Item, err error) (*Unnamed, error) { } // FromStackItem retrieves fields of Unnamed from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *Unnamed) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -839,8 +839,8 @@ func ComplicatedNameEventsFromApplicationLog(log *result.ApplicationLog) ([]*Com return res, nil } -// FromStackItem converts provided stackitem.Array to ComplicatedNameEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to ComplicatedNameEvent or +// returns an error if it's not possible to do to so. func (e *ComplicatedNameEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -900,8 +900,8 @@ func SomeMapEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeMapEven return res, nil } -// FromStackItem converts provided stackitem.Array to SomeMapEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeMapEvent or +// returns an error if it's not possible to do to so. func (e *SomeMapEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -1033,8 +1033,8 @@ func SomeStructEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeStru return res, nil } -// FromStackItem converts provided stackitem.Array to SomeStructEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeStructEvent or +// returns an error if it's not possible to do to so. func (e *SomeStructEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") @@ -1085,8 +1085,8 @@ func SomeArrayEventsFromApplicationLog(log *result.ApplicationLog) ([]*SomeArray return res, nil } -// FromStackItem converts provided stackitem.Array to SomeArrayEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to SomeArrayEvent or +// returns an error if it's not possible to do to so. func (e *SomeArrayEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") diff --git a/cli/smartcontract/testdata/structs/rpcbindings.out b/cli/smartcontract/testdata/structs/rpcbindings.out index 29af22323..5ac5bdcd1 100644 --- a/cli/smartcontract/testdata/structs/rpcbindings.out +++ b/cli/smartcontract/testdata/structs/rpcbindings.out @@ -200,7 +200,7 @@ func itemToLedgerBlock(item stackitem.Item, err error) (*LedgerBlock, error) { } // FromStackItem retrieves fields of LedgerBlock from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -322,7 +322,7 @@ func itemToLedgerBlockSR(item stackitem.Item, err error) (*LedgerBlockSR, error) } // FromStackItem retrieves fields of LedgerBlockSR from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -460,7 +460,7 @@ func itemToLedgerTransaction(item stackitem.Item, err error) (*LedgerTransaction } // FromStackItem retrieves fields of LedgerTransaction from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -556,7 +556,7 @@ func itemToLedgerTransactionSigner(item stackitem.Item, err error) (*LedgerTrans } // FromStackItem retrieves fields of LedgerTransactionSigner from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -683,7 +683,7 @@ func itemToLedgerWitnessCondition(item stackitem.Item, err error) (*LedgerWitnes } // FromStackItem retrieves fields of LedgerWitnessCondition from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -723,7 +723,7 @@ func itemToLedgerWitnessRule(item stackitem.Item, err error) (*LedgerWitnessRule } // FromStackItem retrieves fields of LedgerWitnessRule from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -763,7 +763,7 @@ func itemToManagementABI(item stackitem.Item, err error) (*ManagementABI, error) } // FromStackItem retrieves fields of ManagementABI from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementABI) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -829,7 +829,7 @@ func itemToManagementContract(item stackitem.Item, err error) (*ManagementContra } // FromStackItem retrieves fields of ManagementContract from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementContract) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -897,7 +897,7 @@ func itemToManagementEvent(item stackitem.Item, err error) (*ManagementEvent, er } // FromStackItem retrieves fields of ManagementEvent from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -959,7 +959,7 @@ func itemToManagementGroup(item stackitem.Item, err error) (*ManagementGroup, er } // FromStackItem retrieves fields of ManagementGroup from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -1009,7 +1009,7 @@ func itemToManagementManifest(item stackitem.Item, err error) (*ManagementManife } // FromStackItem retrieves fields of ManagementManifest from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -1201,7 +1201,7 @@ func itemToManagementMethod(item stackitem.Item, err error) (*ManagementMethod, } // FromStackItem retrieves fields of ManagementMethod from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -1281,7 +1281,7 @@ func itemToManagementParameter(item stackitem.Item, err error) (*ManagementParam } // FromStackItem retrieves fields of ManagementParameter from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -1330,7 +1330,7 @@ func itemToManagementPermission(item stackitem.Item, err error) (*ManagementPerm } // FromStackItem retrieves fields of ManagementPermission from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -1402,7 +1402,7 @@ func itemToStructsInternal(item stackitem.Item, err error) (*StructsInternal, er } // FromStackItem retrieves fields of StructsInternal from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *StructsInternal) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { diff --git a/cli/smartcontract/testdata/verifyrpc/verify.go b/cli/smartcontract/testdata/verifyrpc/verify.go index dd3539901..be1f5c671 100644 --- a/cli/smartcontract/testdata/verifyrpc/verify.go +++ b/cli/smartcontract/testdata/verifyrpc/verify.go @@ -102,8 +102,8 @@ func HelloWorldEventsFromApplicationLog(log *result.ApplicationLog) ([]*HelloWor return res, nil } -// FromStackItem converts provided stackitem.Array to HelloWorldEvent and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to HelloWorldEvent or +// returns an error if it's not possible to do to so. func (e *HelloWorldEvent) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item") diff --git a/pkg/smartcontract/rpcbinding/binding.go b/pkg/smartcontract/rpcbinding/binding.go index 746dcb34b..5f1495af3 100644 --- a/pkg/smartcontract/rpcbinding/binding.go +++ b/pkg/smartcontract/rpcbinding/binding.go @@ -236,7 +236,7 @@ func itemTo{{toTypeName $name}}(item stackitem.Item, err error) (*{{toTypeName $ } // FromStackItem retrieves fields of {{toTypeName $name}} from the given stack item -// and returns an error if so. +// or returns an error if it's not possible to do to so. func (res *{{toTypeName $name}}) FromStackItem(item stackitem.Item) error { arr, ok := item.Value().([]stackitem.Item) if !ok { @@ -287,8 +287,8 @@ func {{$e.Name}}sFromApplicationLog(log *result.ApplicationLog) ([]*{{$e.Name}}, return res, nil } -// FromStackItem converts provided stackitem.Array to {{$e.Name}} and -// returns an error if so. +// FromStackItem converts provided stackitem.Array to {{$e.Name}} or +// returns an error if it's not possible to do to so. func (e *{{$e.Name}}) FromStackItem(item *stackitem.Array) error { if item == nil { return errors.New("nil item")