core: add System.Blockchain.GetTransactionFromBlock interop

This commit is contained in:
Anna Shaleva 2020-06-09 12:18:08 +03:00
parent 1e63ae4b3f
commit d692de5ea4
6 changed files with 103 additions and 9 deletions

View file

@ -306,11 +306,16 @@ func TestContractIsPayable(t *testing.T) {
// Helper functions to create VM, InteropContext, TX, Account, Contract.
func createVMAndPushBlock(t *testing.T) (*vm.VM, *block.Block, *interop.Context, *Blockchain) {
v, block, context, chain := createVMAndBlock(t)
v.Estack().PushVal(stackitem.NewInterop(block))
return v, block, context, chain
}
func createVMAndBlock(t *testing.T) (*vm.VM, *block.Block, *interop.Context, *Blockchain) {
v := vm.New()
block := newDumbBlock()
chain := newTestChain(t)
context := chain.newInteropContext(trigger.Application, dao.NewSimple(storage.NewMemoryStore()), block, nil)
v.Estack().PushVal(stackitem.NewInterop(block))
return v, block, context, chain
}