From 773bcc3a5953bd4a50f577a5b447af8745da5a98 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 31 Aug 2022 13:02:54 +0300 Subject: [PATCH] context: make error messages a bit less cryptic Refs. #2664. --- pkg/smartcontract/context/context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/smartcontract/context/context.go b/pkg/smartcontract/context/context.go index cd4d09d0e..598149070 100644 --- a/pkg/smartcontract/context/context.go +++ b/pkg/smartcontract/context/context.go @@ -65,9 +65,9 @@ func (c *ParameterContext) GetWitness(h util.Uint160) (*transaction.Witness, err bw := io.NewBufBinWriter() for i := range item.Parameters { if item.Parameters[i].Type != smartcontract.SignatureType { - return nil, errors.New("only signature parameters are supported") + return nil, fmt.Errorf("unsupported %s parameter #%d", item.Parameters[i].Type.String(), i) } else if item.Parameters[i].Value == nil { - return nil, errors.New("nil parameter") + return nil, fmt.Errorf("no value for parameter #%d (not signed yet?)", i) } emit.Bytes(bw.BinWriter, item.Parameters[i].Value.([]byte)) }