core: move DAO to a separate package

This commit is contained in:
Evgenii Stratonikov 2020-04-07 12:41:12 +03:00
parent 4e0c3fab0f
commit 030b7754ad
13 changed files with 232 additions and 223 deletions

View file

@ -11,6 +11,7 @@ import (
"sort"
"github.com/nspcc-dev/neo-go/pkg/core/block"
"github.com/nspcc-dev/neo-go/pkg/core/dao"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger"
@ -23,13 +24,13 @@ type interopContext struct {
trigger trigger.Type
block *block.Block
tx *transaction.Transaction
dao *cachedDao
dao *dao.Cached
notifications []state.NotificationEvent
log *zap.Logger
}
func newInteropContext(trigger trigger.Type, bc Blockchainer, d dao, block *block.Block, tx *transaction.Transaction, log *zap.Logger) *interopContext {
dao := newCachedDao(d)
func newInteropContext(trigger trigger.Type, bc Blockchainer, d dao.DAO, block *block.Block, tx *transaction.Transaction, log *zap.Logger) *interopContext {
dao := dao.NewCached(d)
nes := make([]state.NotificationEvent, 0)
return &interopContext{bc, trigger, block, tx, dao, nes, log}
}