core/vm: implement contract storage and script retrieval

Fixes script invocations via the APPCALL instruction. Adjust contract state
field types accordingly.
This commit is contained in:
Roman Khimov 2019-09-30 19:52:16 +03:00
parent e83dc94744
commit ceca9cdb67
6 changed files with 175 additions and 16 deletions

View file

@ -1000,7 +1000,12 @@ func TestAppCall(t *testing.T) {
prog = append(prog, byte(RET))
vm := load(prog)
vm.scripts[hash] = makeProgram(DEPTH)
vm.SetScriptGetter(func(in util.Uint160) []byte {
if in.Equals(hash) {
return makeProgram(DEPTH)
}
return nil
})
vm.estack.PushVal(2)
vm.Run()