smartcontract: improve invalid notification error text

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2023-08-10 13:54:07 +03:00
parent 5c6a111d00
commit 60795a899f

View file

@ -66,11 +66,11 @@ func (e *Event) FromStackItem(item stackitem.Item) error {
// current event.
func (e *Event) CheckCompliance(items []stackitem.Item) error {
if len(items) != len(e.Parameters) {
return errors.New("mismatch between the number of parameters and items")
return fmt.Errorf("mismatch between the number of parameters and items: %d vs %d", len(e.Parameters), len(items))
}
for i := range items {
if !e.Parameters[i].Type.Match(items[i]) {
return fmt.Errorf("parameter %d type mismatch: %s vs %s", i, e.Parameters[i].Type.String(), items[i].Type().String())
return fmt.Errorf("parameter %d type mismatch: %s (manifest) vs %s (notification)", i, e.Parameters[i].Type.String(), items[i].Type().String())
}
}
return nil