core: return *interop.Context from GetTestVM
Return everything needed, fix #2273.
This commit is contained in:
parent
ab2e60458d
commit
9f9bd7261c
9 changed files with 57 additions and 56 deletions
|
@ -613,12 +613,12 @@ func setTxSystemFee(bc *Blockchain, sysFee int64, tx *transaction.Transaction) {
|
|||
}
|
||||
|
||||
ttx := *tx // prevent setting 'hash' field
|
||||
v, f := bc.GetTestVM(trigger.Application, &ttx, b)
|
||||
defer f()
|
||||
ic := bc.GetTestVM(trigger.Application, &ttx, b)
|
||||
defer ic.Finalize()
|
||||
|
||||
v.LoadWithFlags(tx.Script, callflag.All)
|
||||
_ = v.Run()
|
||||
tx.SystemFee = v.GasConsumed()
|
||||
ic.VM.LoadWithFlags(tx.Script, callflag.All)
|
||||
_ = ic.VM.Run()
|
||||
tx.SystemFee = ic.VM.GasConsumed()
|
||||
}
|
||||
|
||||
func signTxWithAccounts(chain *Blockchain, sysFee int64, tx *transaction.Transaction, accs ...*wallet.Account) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue