forked from TrueCloudLab/neoneo-go
*: don't use dao.Cached in tests
There is no need to use it.
This commit is contained in:
parent
18682f2409
commit
50ee1a1f91
3 changed files with 6 additions and 6 deletions
|
@ -174,7 +174,7 @@ func TestCheckSig(t *testing.T) {
|
|||
|
||||
verifyFunc := ECDSASecp256r1CheckSig
|
||||
d := dao.NewSimple(storage.NewMemoryStore(), false)
|
||||
ic := &interop.Context{Network: uint32(netmode.UnitTestNet), DAO: dao.NewCached(d)}
|
||||
ic := &interop.Context{Network: uint32(netmode.UnitTestNet), DAO: d}
|
||||
runCase := func(t *testing.T, isErr bool, result interface{}, args ...interface{}) {
|
||||
ic.SpawnVM()
|
||||
for i := range args {
|
||||
|
|
|
@ -45,7 +45,7 @@ func TestRuntimeGetRandomCompatibility(t *testing.T) {
|
|||
|
||||
b := getSharpTestGenesis(t)
|
||||
tx := getSharpTestTx(util.Uint160{})
|
||||
ic := bc.newInteropContext(trigger.Application, dao.NewCached(bc.dao), b, tx)
|
||||
ic := bc.newInteropContext(trigger.Application, bc.dao.GetWrapped(), b, tx)
|
||||
ic.Network = 5195086 // Old mainnet magic used by C# tests.
|
||||
|
||||
ic.VM = vm.New()
|
||||
|
@ -72,12 +72,12 @@ func TestRuntimeGetRandomDifferentTransactions(t *testing.T) {
|
|||
b, _ := bc.GetBlock(bc.GetHeaderHash(0))
|
||||
|
||||
tx1 := transaction.New([]byte{byte(opcode.PUSH1)}, 0)
|
||||
ic1 := bc.newInteropContext(trigger.Application, dao.NewCached(bc.dao), b, tx1)
|
||||
ic1 := bc.newInteropContext(trigger.Application, bc.dao.GetWrapped(), b, tx1)
|
||||
ic1.VM = vm.New()
|
||||
ic1.VM.LoadScript(tx1.Script)
|
||||
|
||||
tx2 := transaction.New([]byte{byte(opcode.PUSH2)}, 0)
|
||||
ic2 := bc.newInteropContext(trigger.Application, dao.NewCached(bc.dao), b, tx2)
|
||||
ic2 := bc.newInteropContext(trigger.Application, bc.dao.GetWrapped(), b, tx2)
|
||||
ic2.VM = vm.New()
|
||||
ic2.VM.LoadScript(tx2.Script)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
|
||||
func TestDeployGetUpdateDestroyContract(t *testing.T) {
|
||||
mgmt := newManagement()
|
||||
d := dao.NewCached(dao.NewSimple(storage.NewMemoryStore(), false))
|
||||
d := dao.NewSimple(storage.NewMemoryStore(), false)
|
||||
err := mgmt.Initialize(&interop.Context{DAO: d})
|
||||
require.NoError(t, err)
|
||||
script := []byte{byte(opcode.RET)}
|
||||
|
@ -86,7 +86,7 @@ func TestManagement_Initialize(t *testing.T) {
|
|||
|
||||
func TestManagement_GetNEP17Contracts(t *testing.T) {
|
||||
mgmt := newManagement()
|
||||
d := dao.NewCached(dao.NewSimple(storage.NewMemoryStore(), false))
|
||||
d := dao.NewSimple(storage.NewMemoryStore(), false)
|
||||
err := mgmt.Initialize(&interop.Context{DAO: d})
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
Loading…
Reference in a new issue