kaspa_consensus_core/errors/
coinbase.rs

1use thiserror::Error;
2
3#[derive(Error, Debug, Clone)]
4pub enum CoinbaseError {
5    #[error("coinbase payload length is {0} while the minimum allowed length is {1}")]
6    PayloadLenBelowMin(usize, usize),
7
8    #[error("coinbase payload length is {0} while the maximum allowed length is {1}")]
9    PayloadLenAboveMax(usize, usize),
10
11    #[error("coinbase payload script public key length is {0} while the maximum allowed length is {1}")]
12    PayloadScriptPublicKeyLenAboveMax(usize, u8),
13
14    #[error("coinbase payload length is {0} bytes but it needs to be at least {1} bytes long in order to accommodate the script public key")]
15    PayloadCantContainScriptPublicKey(usize, usize),
16}
17
18pub type CoinbaseResult<T> = std::result::Result<T, CoinbaseError>;