core: simplify newInteropContext

This commit is contained in:
Evgenii Stratonikov 2019-12-30 14:01:49 +03:00
parent 45a4524054
commit 637c99eda7
3 changed files with 16 additions and 14 deletions

View file

@ -9,13 +9,12 @@ import (
"github.com/CityOfZion/neo-go/pkg/smartcontract/trigger"
"github.com/CityOfZion/neo-go/pkg/vm"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)
func testNonInterop(t *testing.T, value interface{}, f func(*interopContext, *vm.VM) error) {
v := vm.New()
v.Estack().PushVal(value)
context := newInteropContext(trigger.Application, newTestChain(t), storage.NewMemoryStore(), nil, nil, zaptest.NewLogger(t))
context := newTestChain(t).newInteropContext(trigger.Application, storage.NewMemoryStore(), nil, nil)
require.Error(t, f(context, v))
}