forked from TrueCloudLab/neoneo-go
core: fix verification call flag
Previous commit sets AllowCall flag as required for Neo.Native.Call, but invocation script was loaded with ReadStates flag => native contracts verification failed. Other contracts can also make use of AllowCall call flag.
This commit is contained in:
parent
53e45d793b
commit
2290b91b83
2 changed files with 2 additions and 2 deletions
|
@ -1674,7 +1674,7 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160,
|
||||||
return ErrInvalidVerificationContract
|
return ErrInvalidVerificationContract
|
||||||
}
|
}
|
||||||
initMD := cs.Manifest.ABI.GetMethod(manifest.MethodInit)
|
initMD := cs.Manifest.ABI.GetMethod(manifest.MethodInit)
|
||||||
v.LoadScriptWithHash(cs.Script, hash, smartcontract.ReadStates)
|
v.LoadScriptWithHash(cs.Script, hash, smartcontract.ReadStates|smartcontract.AllowCall)
|
||||||
v.Jump(v.Context(), md.Offset)
|
v.Jump(v.Context(), md.Offset)
|
||||||
|
|
||||||
if cs.ID < 0 {
|
if cs.ID < 0 {
|
||||||
|
|
|
@ -58,7 +58,7 @@ func Call(ic *interop.Context) error {
|
||||||
return fmt.Errorf("method %s not found", operation)
|
return fmt.Errorf("method %s not found", operation)
|
||||||
}
|
}
|
||||||
if !ic.VM.Context().GetCallFlags().Has(m.RequiredFlags) {
|
if !ic.VM.Context().GetCallFlags().Has(m.RequiredFlags) {
|
||||||
return errors.New("missing call flags")
|
return fmt.Errorf("missing call flags for native %s `%s` operation call: %05b vs %05b", name, operation, ic.VM.Context().GetCallFlags(), m.RequiredFlags)
|
||||||
}
|
}
|
||||||
if !ic.VM.AddGas(m.Price) {
|
if !ic.VM.AddGas(m.Price) {
|
||||||
return errors.New("gas limit exceeded")
|
return errors.New("gas limit exceeded")
|
||||||
|
|
Loading…
Reference in a new issue