-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOD-1413] Make some additional interface changes (#954)
* [NOD-1413] Remove /cmd/addblock * [NOD-1413] Define and implement TransactionValidator. * [NOD-1413] Make changes to ConsensusStateManager's interface. * [NOD-1413] Make changes to PruningManager's interface. * [NOD-1413] Make changes to DAGTraversalManager's interface. * [NOD-1413] Make changes to MultisetStore's interface. * [NOD-1413] Make changes to UTXODiffStore's interface. * [NOD-1413] Make changes to UTXODiffStore's interface harder. * [NOD-1413] Make changes to AcceptanceDataStore's interface harder. * [NOD-1413] Make changes to PruningStore's interface. * [NOD-1413] Delete BlockIndex. * [NOD-1413] Add FeeDataStore. * [NOD-1413] Update BlockMessageStore's interface. * [NOD-1413] Fix interface violations. * [NOD-1413] Add FeeDataStore to BlockProcessor. * [NOD-1413] Make go vet happy. * [NOD-1413] Add missing fields to ConsensusStateChanges. * [NOD-1413] Add another missing field to ConsensusStateChanges. * [NOD-1413] Add a reference to blockStore in consensusStateManager. * [NOD-1413] Add missing methods to UTXODiffStore. * [NOD-1413] Rename pruningPointStore to pruningStore everywhere. * [NOD-1413] Remove superfluous parameters from CalculateConsensusStateChanges. * [NOD-1413] Add missing dependencies to PruningManager. * [NOD-1413] Remove implementation-y functions from TransactionValidator's interface. * [NOD-1413] Make go vet happy. * [NOD-1413] Add a couple of methods to DAGTopologyManager. * [NOD-1413] Fix a typo in a file name. * [NOD-1413] Remove non-interface functions from Validator.
- Loading branch information
1 parent
04ead57
commit 4f36acc
Showing
36 changed files
with
325 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
domain/consensus/datastructures/blockmessagestore/blockmessagestore.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package blockstore | ||
|
||
import ( | ||
"github.com/kaspanet/kaspad/domain/consensus/model" | ||
) | ||
|
||
// BlockStore represents a store of blocks | ||
type BlockStore struct { | ||
} | ||
|
||
// New instantiates a new BlockStore | ||
func New() *BlockStore { | ||
return &BlockStore{} | ||
} | ||
|
||
// Insert inserts the given block for the given blockHash | ||
func (bms *BlockStore) Insert(dbTx model.DBTxProxy, blockHash *model.DomainHash, msgBlock *model.DomainBlock) { | ||
|
||
} | ||
|
||
// Block gets the block associated with the given blockHash | ||
func (bms *BlockStore) Block(dbContext model.DBContextProxy, blockHash *model.DomainHash) *model.DomainBlock { | ||
return nil | ||
} | ||
|
||
// Blocks gets the blocks associated with the given blockHashes | ||
func (bms *BlockStore) Blocks(dbContext model.DBContextProxy, blockHashes []*model.DomainHash) []*model.DomainBlock { | ||
return nil | ||
} | ||
|
||
// Delete deletes the block associated with the given blockHash | ||
func (bms *BlockStore) Delete(dbTx model.DBTxProxy, blockHash *model.DomainHash) { | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
domain/consensus/datastructures/feedatastore/feedatastore.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package feedatastore | ||
|
||
import "github.com/kaspanet/kaspad/domain/consensus/model" | ||
|
||
// FeeDataStore represents a store of fee data | ||
type FeeDataStore struct { | ||
} | ||
|
||
// New instantiates a new FeeDataStore | ||
func New() *FeeDataStore { | ||
return &FeeDataStore{} | ||
} | ||
|
||
// Insert inserts the given fee for the given blockHash | ||
func (ads *FeeDataStore) Insert(dbTx model.DBTxProxy, blockHash *model.DomainHash, fee uint64) { | ||
|
||
} | ||
|
||
// Get gets the fee associated with the given blockHash | ||
func (ads *FeeDataStore) Get(dbContext model.DBContextProxy, blockHash *model.DomainHash) uint64 { | ||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
domain/consensus/datastructures/pruningpointstore/pruningpointstore.go
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
domain/consensus/datastructures/pruningstore/pruningstore.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package pruningstore | ||
|
||
import ( | ||
"github.com/kaspanet/kaspad/domain/consensus/model" | ||
) | ||
|
||
// PruningStore represents a store for the current pruning state | ||
type PruningStore struct { | ||
} | ||
|
||
// New instantiates a new PruningStore | ||
func New() *PruningStore { | ||
return &PruningStore{} | ||
} | ||
|
||
// Update updates the pruning state | ||
func (pps *PruningStore) Update(dbTx model.DBTxProxy, pruningPointBlockHash *model.DomainHash, pruningPointUTXOSet model.ReadOnlyUTXOSet) { | ||
|
||
} | ||
|
||
// PruningPoint gets the current pruning point | ||
func (pps *PruningStore) PruningPoint(dbContext model.DBContextProxy) *model.DomainHash { | ||
return nil | ||
} | ||
|
||
// PruningPointSerializedUTXOSet returns the serialized UTXO set of the current pruning point | ||
func (pps *PruningStore) PruningPointSerializedUTXOSet(dbContext model.DBContextProxy) []byte { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package model | ||
|
||
// BlockStore represents a store of blocks | ||
type BlockStore interface { | ||
Insert(dbTx DBTxProxy, blockHash *DomainHash, block *DomainBlock) | ||
Block(dbContext DBContextProxy, blockHash *DomainHash) *DomainBlock | ||
Blocks(dbContext DBContextProxy, blockHashes []*DomainHash) []*DomainBlock | ||
Delete(dbTx DBTxProxy, blockHash *DomainHash) | ||
} |
7 changes: 0 additions & 7 deletions
7
domain/consensus/model/interface_datastructures_blockindex.go
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
domain/consensus/model/interface_datastructures_blockmessage.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
domain/consensus/model/interface_datastructures_feedatastore.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package model | ||
|
||
// FeeDataStore represents a store of fee data | ||
type FeeDataStore interface { | ||
Insert(dbTx DBTxProxy, blockHash *DomainHash, fee uint64) | ||
Get(dbContext DBContextProxy, blockHash *DomainHash) uint64 | ||
} |
Oops, something went wrong.