core: refactoring blockchain state and storage
add dao which takes care about all CRUD operations on storage remove blockchain state since everything is stored on change remove storage operations from structs(entities) move structs to entities package
This commit is contained in:
parent
c43ff15c78
commit
ec17654986
39 changed files with 958 additions and 1258 deletions
|
@ -8,6 +8,7 @@ package core
|
|||
*/
|
||||
|
||||
import (
|
||||
"github.com/CityOfZion/neo-go/pkg/core/entities"
|
||||
"github.com/CityOfZion/neo-go/pkg/core/storage"
|
||||
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
||||
"github.com/CityOfZion/neo-go/pkg/vm"
|
||||
|
@ -18,14 +19,14 @@ type interopContext struct {
|
|||
trigger byte
|
||||
block *Block
|
||||
tx *transaction.Transaction
|
||||
mem *storage.MemCachedStore
|
||||
notifications []NotificationEvent
|
||||
dao *dao
|
||||
notifications []entities.NotificationEvent
|
||||
}
|
||||
|
||||
func newInteropContext(trigger byte, bc Blockchainer, s storage.Store, block *Block, tx *transaction.Transaction) *interopContext {
|
||||
mem := storage.NewMemCachedStore(s)
|
||||
nes := make([]NotificationEvent, 0)
|
||||
return &interopContext{bc, trigger, block, tx, mem, nes}
|
||||
dao := &dao{store: storage.NewMemCachedStore(s)}
|
||||
nes := make([]entities.NotificationEvent, 0)
|
||||
return &interopContext{bc, trigger, block, tx, dao, nes}
|
||||
}
|
||||
|
||||
// All lists are sorted, keep 'em this way, please.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue