core: use ic.SpawnVM() in tests, not vm.New()

vm.New() sets some arbitrary trigger while interop context always sets
something appropriate according to its state.
This commit is contained in:
Roman Khimov 2020-10-29 19:10:28 +03:00
parent d4da811d12
commit 2924ecd453
4 changed files with 20 additions and 25 deletions

View file

@ -79,7 +79,7 @@ func TestDesignate_DesignateAsRole(t *testing.T) {
des := bc.contracts.Designate
tx := transaction.New(netmode.UnitTestNet, []byte{}, 0)
ic := bc.newInteropContext(trigger.System, bc.dao, nil, tx)
ic.VM = vm.New()
ic.SpawnVM()
ic.VM.LoadScript([]byte{byte(opcode.RET)})
pubs, err := des.GetDesignatedByRole(bc.dao, 0xFF)