kaspad/domain/consensus/test_consensus_getters.go
Ori Newman 48e1a2c396
New headers first flow (#1211)
* Get rid of insertMode

* Rename AddBlockToVirtual->AddBlock

* When F is not in the future of P, enforce finality with P and not with F.

* Don't allow blocks with invalid parents or with missing block body

* Check finality violation before checking block status

* Implement CalculateIndependentPruningPoint

* Move checkBlockStatus to validateBlock

* Add ValidateBlock to block processor interface

* Adjust SetPruningPoint to the new IBD flow

* Add pruning store to CSM's constructor

* Flip wrong condition on AddHeaderTip

* Fix func (hts *headerSelectedTipStore) Has

* Fix block stage order

* Call to ValidateBodyInContext from validatePostProofOfWork

* Enable overrideDAGParams

* Update log

* Rename SetPruningPoint to ValidateAndInsertPruningPoint and move most of its logic inside block processor

* Rename hasValidatedHeader->hasValidatedOnlyHeader

* Fix typo

* Name return values for fetchMissingUTXOSet

* Add comment

* Return ErrMissingParents when block body is missing

* Add logs and comments

* Fix merge error

* Fix pruning point calculation to be by virtual selected parent

* Replace CalculateIndependentPruningPoint to CalculatePruningPointByHeaderSelectedTip

* Fix isAwaitingUTXOSet to check pruning point by headers

* Change isAwaitingUTXOSet indication

* Remove IsBlockInHeaderPruningPointFuture from BlockInfo

* Fix LowestChainBlockAboveOrEqualToBlueScore

* Add validateNewPruningPointTransactions

* Add validateNewPruningAgainstPastUTXO

* Rename set_pruning_utxo_set.go to update_pruning_utxo_set.go

* Check missing block body hashes by missing block instead of status

* Validate pruning point against past UTXO with the pruning point as block hash

* Remove virtualHeaderHash

* Fix comment

* Fix imports
2020-12-14 17:53:08 +02:00

131 lines
3.2 KiB
Go

package consensus
import (
"github.com/kaspanet/kaspad/domain/consensus/model"
"github.com/kaspanet/kaspad/domain/consensus/model/testapi"
)
func (tc *testConsensus) DatabaseContext() model.DBReader {
return tc.databaseContext
}
func (tc *testConsensus) AcceptanceDataStore() model.AcceptanceDataStore {
return tc.acceptanceDataStore
}
func (tc *testConsensus) BlockHeaderStore() model.BlockHeaderStore {
return tc.blockHeaderStore
}
func (tc *testConsensus) BlockRelationStore() model.BlockRelationStore {
return tc.blockRelationStore
}
func (tc *testConsensus) BlockStatusStore() model.BlockStatusStore {
return tc.blockStatusStore
}
func (tc *testConsensus) BlockStore() model.BlockStore {
return tc.blockStore
}
func (tc *testConsensus) ConsensusStateStore() model.ConsensusStateStore {
return tc.consensusStateStore
}
func (tc *testConsensus) GHOSTDAGDataStore() model.GHOSTDAGDataStore {
return tc.ghostdagDataStore
}
func (tc *testConsensus) HeaderTipsStore() model.HeaderSelectedTipStore {
return tc.headersSelectedTipStore
}
func (tc *testConsensus) MultisetStore() model.MultisetStore {
return tc.multisetStore
}
func (tc *testConsensus) PruningStore() model.PruningStore {
return tc.pruningStore
}
func (tc *testConsensus) ReachabilityDataStore() model.ReachabilityDataStore {
return tc.reachabilityDataStore
}
func (tc *testConsensus) UTXODiffStore() model.UTXODiffStore {
return tc.utxoDiffStore
}
func (tc *testConsensus) BlockBuilder() testapi.TestBlockBuilder {
return tc.testBlockBuilder
}
func (tc *testConsensus) BlockProcessor() model.BlockProcessor {
return tc.blockProcessor
}
func (tc *testConsensus) BlockValidator() model.BlockValidator {
return tc.blockValidator
}
func (tc *testConsensus) CoinbaseManager() model.CoinbaseManager {
return tc.coinbaseManager
}
func (tc *testConsensus) ConsensusStateManager() testapi.TestConsensusStateManager {
return tc.testConsensusStateManager
}
func (tc *testConsensus) DAGTopologyManager() model.DAGTopologyManager {
return tc.dagTopologyManager
}
func (tc *testConsensus) DAGTraversalManager() model.DAGTraversalManager {
return tc.dagTraversalManager
}
func (tc *testConsensus) DifficultyManager() model.DifficultyManager {
return tc.difficultyManager
}
func (tc *testConsensus) GHOSTDAGManager() model.GHOSTDAGManager {
return tc.ghostdagManager
}
func (tc *testConsensus) HeaderTipsManager() model.HeadersSelectedTipManager {
return tc.headerTipsManager
}
func (tc *testConsensus) MergeDepthManager() model.MergeDepthManager {
return tc.mergeDepthManager
}
func (tc *testConsensus) PastMedianTimeManager() model.PastMedianTimeManager {
return tc.pastMedianTimeManager
}
func (tc *testConsensus) PruningManager() model.PruningManager {
return tc.pruningManager
}
func (tc *testConsensus) ReachabilityManager() testapi.TestReachabilityManager {
return tc.testReachabilityManager
}
func (tc *testConsensus) SyncManager() model.SyncManager {
return tc.syncManager
}
func (tc *testConsensus) TransactionValidator() testapi.TestTransactionValidator {
return tc.testTransactionValidator
}
func (tc *testConsensus) FinalityManager() model.FinalityManager {
return tc.finalityManager
}
func (tc *testConsensus) FinalityStore() model.FinalityStore {
return tc.finalityStore
}