mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
core,rpc: close Blockchain in tests
If blockchain is not closed, logging in defer can occur after test has finished, which will lead to a panic with "Log in goroutine after Test* has completed".
This commit is contained in:
parent
dc65684708
commit
9dc5571327
3 changed files with 97 additions and 52 deletions
|
@ -14,7 +14,9 @@ import (
|
|||
func testNonInterop(t *testing.T, value interface{}, f func(*interopContext, *vm.VM) error) {
|
||||
v := vm.New()
|
||||
v.Estack().PushVal(value)
|
||||
context := newTestChain(t).newInteropContext(trigger.Application, storage.NewMemoryStore(), nil, nil)
|
||||
chain := newTestChain(t)
|
||||
defer chain.Close()
|
||||
context := chain.newInteropContext(trigger.Application, storage.NewMemoryStore(), nil, nil)
|
||||
require.Error(t, f(context, v))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue