[NOD-1466] Move UTXODiffStore from ConsensusStateManager to UTXODiffManager (#961)

This commit is contained in:
Svarog 2020-10-21 10:19:41 +03:00 committed by GitHub
parent 8c63835971
commit 4c1f24da82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -69,14 +69,13 @@ func (f *factory) NewConsensus(dagParams *dagconfig.Params, databaseContext *dba
dagTraversalManager := dagtraversalmanager.New(
dagTopologyManager,
ghostdagManager)
utxoDiffManager := utxodiffmanager.New()
utxoDiffManager := utxodiffmanager.New(utxoDiffStore)
acceptanceManager := acceptancemanager.New(utxoDiffManager)
consensusStateManager := consensusstatemanager.New(
domainDBContext,
dagParams,
consensusStateStore,
multisetStore,
utxoDiffStore,
blockStore,
ghostdagManager,
acceptanceManager)

View File

@ -14,7 +14,6 @@ type consensusStateManager struct {
databaseContext *database.DomainDBContext
consensusStateStore model.ConsensusStateStore
multisetStore model.MultisetStore
utxoDiffStore model.UTXODiffStore
blockStore model.BlockStore
ghostdagManager model.GHOSTDAGManager
acceptanceManager model.AcceptanceManager
@ -26,7 +25,6 @@ func New(
dagParams *dagconfig.Params,
consensusStateStore model.ConsensusStateStore,
multisetStore model.MultisetStore,
utxoDiffStore model.UTXODiffStore,
blockStore model.BlockStore,
ghostdagManager model.GHOSTDAGManager,
acceptanceManager model.AcceptanceManager) model.ConsensusStateManager {
@ -37,7 +35,6 @@ func New(
databaseContext: databaseContext,
consensusStateStore: consensusStateStore,
multisetStore: multisetStore,
utxoDiffStore: utxoDiffStore,
blockStore: blockStore,
ghostdagManager: ghostdagManager,
acceptanceManager: acceptanceManager,

View File

@ -8,11 +8,14 @@ import (
// UTXODiffManager provides methods to access
// and store UTXO diffs
type utxoDiffManager struct {
utxoDiffStore model.UTXODiffStore
}
// New instantiates a new UTXODiffManager
func New() model.UTXODiffManager {
return &utxoDiffManager{}
func New(utxoDiffStore model.UTXODiffStore) model.UTXODiffManager {
return &utxoDiffManager{
utxoDiffStore: utxoDiffStore,
}
}
// StoreUTXODiff stores the given utxoDiff for the given blockHash