Trait grin_pool::types::BlockChain
source · pub trait BlockChain: Sync + Send {
// Required methods
fn verify_coinbase_maturity(&self, inputs: &Inputs) -> Result<(), PoolError>;
fn verify_tx_lock_height(&self, tx: &Transaction) -> Result<(), PoolError>;
fn validate_tx(&self, tx: &Transaction) -> Result<(), PoolError>;
fn validate_inputs(
&self,
inputs: &Inputs
) -> Result<Vec<OutputIdentifier>, PoolError>;
fn chain_head(&self) -> Result<BlockHeader, PoolError>;
fn get_block_header(&self, hash: &Hash) -> Result<BlockHeader, PoolError>;
fn get_block_sums(&self, hash: &Hash) -> Result<BlockSums, PoolError>;
}
Expand description
Interface that the pool requires from a blockchain implementation.
Required Methods§
sourcefn verify_coinbase_maturity(&self, inputs: &Inputs) -> Result<(), PoolError>
fn verify_coinbase_maturity(&self, inputs: &Inputs) -> Result<(), PoolError>
Verify any coinbase outputs being spent have matured sufficiently.
sourcefn verify_tx_lock_height(&self, tx: &Transaction) -> Result<(), PoolError>
fn verify_tx_lock_height(&self, tx: &Transaction) -> Result<(), PoolError>
Verify any coinbase outputs being spent have matured sufficiently.
sourcefn validate_tx(&self, tx: &Transaction) -> Result<(), PoolError>
fn validate_tx(&self, tx: &Transaction) -> Result<(), PoolError>
Validate a transaction against the current utxo.
sourcefn validate_inputs(
&self,
inputs: &Inputs
) -> Result<Vec<OutputIdentifier>, PoolError>
fn validate_inputs( &self, inputs: &Inputs ) -> Result<Vec<OutputIdentifier>, PoolError>
Validate inputs against the current utxo. Returns the vec of output identifiers that would be spent by these inputs if they can all be successfully spent.