core, rpc: move getFakeNextBlock to Blockchain

It's needed for VM CLI as far and may be improved later.
This commit is contained in:
Anna Shaleva 2022-10-06 13:24:57 +03:00
parent 0036c89d63
commit 79e13f73d8
13 changed files with 136 additions and 89 deletions

View file

@ -374,7 +374,8 @@ func TestInvoke(bc *core.Blockchain, tx *transaction.Transaction) (*vm.VM, error
// `GetTestVM` as well as `Run` can use a transaction hash which will set a cached value.
// This is unwanted behavior, so we explicitly copy the transaction to perform execution.
ttx := *tx
ic := bc.GetTestVM(trigger.Application, &ttx, b)
ic, _ := bc.GetTestVM(trigger.Application, &ttx, b)
defer ic.Finalize()
ic.VM.LoadWithFlags(tx.Script, callflag.All)