forked from cerc-io/laconicd-deprecated
CSDB Keeper (#76)
- Implements Keeper. This is a wrapper around the "real" keeper (CSDB). Since we need to pass the context into the keeper we need to abstract the CSDB from the - Adds WithContext() to CSDB to support the above requirement - Adds Keeper to app
This commit is contained in:
+3
-4
@@ -4,7 +4,6 @@ const (
|
||||
// module name
|
||||
ModuleName = "ethermint"
|
||||
|
||||
// TODO: Use this
|
||||
// StoreKey to be used when creating the KVStore
|
||||
StoreKey = ModuleName
|
||||
)
|
||||
EvmStoreKey = "evmstore"
|
||||
EvmCodeKey = "evmcode"
|
||||
)
|
||||
|
||||
@@ -82,7 +82,7 @@ type CommitStateDB struct {
|
||||
//
|
||||
// CONTRACT: Stores used for state must be cache-wrapped as the ordering of the
|
||||
// key/value space matters in determining the merkle root.
|
||||
func NewCommitStateDB(ctx sdk.Context, ak auth.AccountKeeper, storageKey, codeKey sdk.StoreKey) (*CommitStateDB, error) {
|
||||
func NewCommitStateDB(ctx sdk.Context, ak auth.AccountKeeper, storageKey, codeKey sdk.StoreKey) *CommitStateDB {
|
||||
return &CommitStateDB{
|
||||
ctx: ctx,
|
||||
ak: ak,
|
||||
@@ -93,7 +93,12 @@ func NewCommitStateDB(ctx sdk.Context, ak auth.AccountKeeper, storageKey, codeKe
|
||||
logs: make(map[ethcmn.Hash][]*ethtypes.Log),
|
||||
preimages: make(map[ethcmn.Hash][]byte),
|
||||
journal: newJournal(),
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (csdb *CommitStateDB) WithContext(ctx sdk.Context) *CommitStateDB {
|
||||
csdb.ctx = ctx
|
||||
return csdb
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user