core: adjust error message of native call

This commit is contained in:
Anna Shaleva 2022-03-23 19:52:59 +03:00
parent 59f3fa1ef1
commit a4dab3a5ba

View file

@ -17,14 +17,15 @@ func Call(ic *interop.Context) error {
return fmt.Errorf("native contract of version %d is not active", version)
}
var c interop.Contract
curr := ic.VM.GetCurrentScriptHash()
for _, ctr := range ic.Natives {
if ctr.Metadata().Hash == ic.VM.GetCurrentScriptHash() {
if ctr.Metadata().Hash == curr {
c = ctr
break
}
}
if c == nil {
return fmt.Errorf("native contract %d not found", version)
return fmt.Errorf("native contract %s (version %d) not found", curr.StringLE(), version)
}
history := c.Metadata().UpdateHistory
if len(history) == 0 {