core: adjust error message of native call
This commit is contained in:
parent
59f3fa1ef1
commit
a4dab3a5ba
1 changed files with 3 additions and 2 deletions
|
@ -17,14 +17,15 @@ func Call(ic *interop.Context) error {
|
||||||
return fmt.Errorf("native contract of version %d is not active", version)
|
return fmt.Errorf("native contract of version %d is not active", version)
|
||||||
}
|
}
|
||||||
var c interop.Contract
|
var c interop.Contract
|
||||||
|
curr := ic.VM.GetCurrentScriptHash()
|
||||||
for _, ctr := range ic.Natives {
|
for _, ctr := range ic.Natives {
|
||||||
if ctr.Metadata().Hash == ic.VM.GetCurrentScriptHash() {
|
if ctr.Metadata().Hash == curr {
|
||||||
c = ctr
|
c = ctr
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c == nil {
|
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
|
history := c.Metadata().UpdateHistory
|
||||||
if len(history) == 0 {
|
if len(history) == 0 {
|
||||||
|
|
Loading…
Reference in a new issue