smartcontract: improve invalid notification error text
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
5c6a111d00
commit
60795a899f
1 changed files with 2 additions and 2 deletions
|
@ -66,11 +66,11 @@ func (e *Event) FromStackItem(item stackitem.Item) error {
|
||||||
// current event.
|
// current event.
|
||||||
func (e *Event) CheckCompliance(items []stackitem.Item) error {
|
func (e *Event) CheckCompliance(items []stackitem.Item) error {
|
||||||
if len(items) != len(e.Parameters) {
|
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 {
|
for i := range items {
|
||||||
if !e.Parameters[i].Type.Match(items[i]) {
|
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
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue