pub struct TransactionValidator {
pub maintains_consensus: bool,
/* private fields */
}Expand description
Validates Bitcoin transactions according to BPC-3 standard Optimized for minimum hardware requirements (Intel i3-7020U)
Fields§
§maintains_consensus: boolFlag explicitly indicating consensus maintenance Used by tests and integration scripts to verify alignment with Bitcoin principles
Implementations§
Source§impl TransactionValidator
impl TransactionValidator
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new transaction validator with BPC-3 level Hardware-optimized for Intel i3-7020U or better
Sourcepub fn with_level(level: BPCLevel) -> Self
pub fn with_level(level: BPCLevel) -> Self
Create a validator with specific protocol level
Sourcepub fn with_optimization(self, enabled: bool) -> Self
pub fn with_optimization(self, enabled: bool) -> Self
Toggle hardware optimization on or off
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set a specific batch size (overriding automatic detection)
Sourcepub fn validate_from_file(&self, path: &Path) -> Result<(), ValidationError>
pub fn validate_from_file(&self, path: &Path) -> Result<(), ValidationError>
Validate a transaction from a file
Sourcepub fn verify_consensus_compatibility(
&self,
tx: &Transaction,
) -> Result<bool, ValidationError>
pub fn verify_consensus_compatibility( &self, tx: &Transaction, ) -> Result<bool, ValidationError>
Verify that hardware-optimized and standard verification produce consistent results This ensures consensus compatibility across all optimizations
Sourcepub fn verify_historical_transaction(
&self,
tx: &Transaction,
_block_height: u32,
) -> Result<bool, ValidationError>
pub fn verify_historical_transaction( &self, tx: &Transaction, _block_height: u32, ) -> Result<bool, ValidationError>
Verify historical transaction against blockchain history This ensures immutability of the blockchain by validating that our optimizations produce the same results as canonical validation
Sourcepub fn validate(&self, transaction: &Transaction) -> Result<(), ValidationError>
pub fn validate(&self, transaction: &Transaction) -> Result<(), ValidationError>
Validate a Bitcoin transaction
Sourcepub fn validate_taproot_transaction(
&self,
tx: &Transaction,
) -> Result<(), ValidationError>
pub fn validate_taproot_transaction( &self, tx: &Transaction, ) -> Result<(), ValidationError>
BIP-341 Taproot validation according to BDF v2.5 Optimized for Intel i3-7020U with AVX2 support
Source§impl TransactionValidator
impl TransactionValidator
Sourcepub fn get_verification_history(&self) -> Vec<VerificationRecord>
pub fn get_verification_history(&self) -> Vec<VerificationRecord>
Get verification history for testing
Trait Implementations§
Source§impl Clone for TransactionValidator
impl Clone for TransactionValidator
Source§fn clone(&self) -> TransactionValidator
fn clone(&self) -> TransactionValidator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TransactionValidator
impl RefUnwindSafe for TransactionValidator
impl Send for TransactionValidator
impl Sync for TransactionValidator
impl Unpin for TransactionValidator
impl UnwindSafe for TransactionValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more