core: allow to use verification contracts

In NEO3 we can't just appcall hash, as verification script has no access
to state. Instead we use `verify` method of an arbitrary contract.
This commit is contained in:
Evgenii Stratonikov 2020-08-13 18:42:53 +03:00
parent 7f2a931fb6
commit 1eb9a4c6c6
4 changed files with 75 additions and 6 deletions

View file

@ -337,6 +337,7 @@ func getTestContractState() (*state.Contract, *state.Contract) {
byte(opcode.LDSFLD0), byte(opcode.ADD), byte(opcode.RET),
byte(opcode.PUSH1), byte(opcode.PUSH2), byte(opcode.RET),
byte(opcode.RET),
byte(opcode.LDSFLD0), byte(opcode.SUB), byte(opcode.CONVERT), byte(stackitem.BooleanT), byte(opcode.RET),
}
h := hash.Hash160(script)
m := manifest.NewManifest(h)
@ -384,6 +385,11 @@ func getTestContractState() (*state.Contract, *state.Contract) {
Offset: 18,
ReturnType: smartcontract.IntegerType,
},
{
Name: manifest.MethodVerify,
Offset: 19,
ReturnType: smartcontract.BoolType,
},
}
cs := &state.Contract{
Script: script,