forked from TrueCloudLab/neoneo-go
core: invoke contract verification script with AllowStates flag
We should call contract's `verify` with AllowStates flag.
This commit is contained in:
parent
eca27055b8
commit
c9acc43023
1 changed files with 3 additions and 1 deletions
|
@ -1590,6 +1590,7 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160,
|
||||||
var isNative bool
|
var isNative bool
|
||||||
var initMD *manifest.Method
|
var initMD *manifest.Method
|
||||||
verification := witness.VerificationScript
|
verification := witness.VerificationScript
|
||||||
|
flags := smartcontract.NoneFlag
|
||||||
if len(verification) != 0 {
|
if len(verification) != 0 {
|
||||||
if witness.ScriptHash() != hash {
|
if witness.ScriptHash() != hash {
|
||||||
return ErrWitnessHashMismatch
|
return ErrWitnessHashMismatch
|
||||||
|
@ -1610,10 +1611,11 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160,
|
||||||
offset = md.Offset
|
offset = md.Offset
|
||||||
initMD = cs.Manifest.ABI.GetMethod(manifest.MethodInit)
|
initMD = cs.Manifest.ABI.GetMethod(manifest.MethodInit)
|
||||||
isNative = cs.ID < 0
|
isNative = cs.ID < 0
|
||||||
|
flags = smartcontract.AllowStates
|
||||||
}
|
}
|
||||||
|
|
||||||
v := ic.VM
|
v := ic.VM
|
||||||
v.LoadScriptWithFlags(verification, smartcontract.NoneFlag)
|
v.LoadScriptWithFlags(verification, flags)
|
||||||
v.Jump(v.Context(), offset)
|
v.Jump(v.Context(), offset)
|
||||||
if isNative {
|
if isNative {
|
||||||
w := io.NewBufBinWriter()
|
w := io.NewBufBinWriter()
|
||||||
|
|
Loading…
Reference in a new issue