mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 13:06:20 +00:00
state: allow to encode AppExecResult with recursive items
1. Encode them to a special type, decode to `nil`. 2. `Interop` can be encoded in JSON, this info should also be preserved.
This commit is contained in:
parent
c13d6ecc55
commit
8c22d27acc
6 changed files with 164 additions and 52 deletions
|
@ -506,6 +506,10 @@ func getTestContractState(bc *Blockchain) (*state.Contract, *state.Contract) {
|
|||
emit.String(w.BinWriter, "destroy")
|
||||
emit.AppCall(w.BinWriter, mgmtHash)
|
||||
emit.Opcodes(w.BinWriter, opcode.RET)
|
||||
invalidStackOff := w.Len()
|
||||
emit.Opcodes(w.BinWriter, opcode.NEWARRAY0, opcode.DUP, opcode.DUP, opcode.APPEND, opcode.NEWMAP)
|
||||
emit.Syscall(w.BinWriter, interopnames.SystemIteratorCreate)
|
||||
emit.Opcodes(w.BinWriter, opcode.RET)
|
||||
|
||||
script := w.Bytes()
|
||||
h := hash.Hash160(script)
|
||||
|
@ -604,6 +608,11 @@ func getTestContractState(bc *Blockchain) (*state.Contract, *state.Contract) {
|
|||
Offset: destroyOff,
|
||||
ReturnType: smartcontract.VoidType,
|
||||
},
|
||||
{
|
||||
Name: "invalidStack",
|
||||
Offset: invalidStackOff,
|
||||
ReturnType: smartcontract.VoidType,
|
||||
},
|
||||
}
|
||||
cs := &state.Contract{
|
||||
Script: script,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue