mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-03 12:46:43 +00:00

* [NOD-1551] Add NewTestConsensusWithDataDir to factory * [NOD-1551] Cache transaction ID * [NOD-1551] Should return err if err != nil * [NOD-1551] BuildBlockWithParents returns the blocks pastUTXOData * [NOD-1551] Set BlockCoinbaseMaturity to 0 in TestDoubleSpends * [NOD-1551] Fix comments * --amend Co-authored-by: Ori Newman <orinewman1@gmail.com>
19 lines
835 B
Go
19 lines
835 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// BlockBuilder is responsible for creating blocks from the current state
|
|
type BlockBuilder interface {
|
|
BuildBlock(coinbaseData *externalapi.DomainCoinbaseData, transactions []*externalapi.DomainTransaction) (*externalapi.DomainBlock, error)
|
|
}
|
|
|
|
// TestBlockBuilder adds to the main BlockBuilder methods required by tests
|
|
type TestBlockBuilder interface {
|
|
BlockBuilder
|
|
|
|
// BuildBlockWithParents builds a block with provided parents, coinbaseData and transactions,
|
|
// and returns the block together with its past UTXO-diff from the virtual.
|
|
BuildBlockWithParents(parentHashes []*externalapi.DomainHash, coinbaseData *externalapi.DomainCoinbaseData,
|
|
transactions []*externalapi.DomainTransaction) (*externalapi.DomainBlock, *UTXODiff, error)
|
|
}
|