mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 23:10:32 +00:00
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:
parent
7f2a931fb6
commit
1eb9a4c6c6
4 changed files with 75 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue