diff --git a/pkg/core/interop/context.go b/pkg/core/interop/context.go index 6e7f94618..1b0f003f8 100644 --- a/pkg/core/interop/context.go +++ b/pkg/core/interop/context.go @@ -42,7 +42,7 @@ type Context struct { Block *block.Block NonceData [16]byte Tx *transaction.Transaction - DAO *dao.Cached + DAO dao.DAO Notifications []state.NotificationEvent Log *zap.Logger VM *vm.VM @@ -54,7 +54,7 @@ type Context struct { func NewContext(trigger trigger.Type, bc blockchainer.Blockchainer, d dao.DAO, getContract func(dao.DAO, util.Uint160) (*state.Contract, error), natives []Contract, block *block.Block, tx *transaction.Transaction, log *zap.Logger) *Context { - dao := dao.NewCached(d) + dao := d.GetWrapped() nes := make([]state.NotificationEvent, 0) return &Context{ Chain: bc, diff --git a/pkg/core/native/ledger.go b/pkg/core/native/ledger.go index 8c901162c..2d958d629 100644 --- a/pkg/core/native/ledger.go +++ b/pkg/core/native/ledger.go @@ -180,7 +180,7 @@ func getBlockHashFromItem(bc blockchainer.Blockchainer, item stackitem.Item) uti // getTransactionAndHeight returns transaction and its height if it's present // on the chain. It panics if anything goes wrong. -func getTransactionAndHeight(cd *dao.Cached, item stackitem.Item) (*transaction.Transaction, uint32, error) { +func getTransactionAndHeight(d dao.DAO, item stackitem.Item) (*transaction.Transaction, uint32, error) { hashbytes, err := item.TryBytes() if err != nil { panic(err) @@ -189,7 +189,7 @@ func getTransactionAndHeight(cd *dao.Cached, item stackitem.Item) (*transaction. if err != nil { panic(err) } - return cd.GetTransaction(hash) + return d.GetTransaction(hash) } // BlockToStackItem converts block.Block to stackitem.Item.