pub struct TransactionValidator { /* private fields */ }
Implementations§
Source§impl TransactionValidator
impl TransactionValidator
pub fn validate_intents_and_structure( &self, intent_tree: &impl IntentTreeStructure, ) -> Result<ValidatedIntentTreeInformation, TransactionValidationError>
Source§impl TransactionValidator
impl TransactionValidator
Sourcepub fn new(
database: &impl SubstateDatabase,
network_definition: &NetworkDefinition,
) -> Self
pub fn new( database: &impl SubstateDatabase, network_definition: &NetworkDefinition, ) -> Self
This is the best constructor to use, as it reads the configuration dynamically Note that the validator needs recreating every time a protocol update runs, as the config can get updated then.
pub fn new_for_latest_simulator() -> Self
pub fn new_with_latest_config(network_definition: &NetworkDefinition) -> Self
pub fn new_with_static_config( config: TransactionValidationConfig, network_id: u8, ) -> Self
pub fn new_with_latest_config_network_agnostic() -> Self
pub fn new_with_static_config_network_agnostic( config: TransactionValidationConfig, ) -> Self
Sourcepub fn network_id(&self) -> Option<u8>
pub fn network_id(&self) -> Option<u8>
pub fn config(&self) -> &TransactionValidationConfig
pub fn preparation_settings(&self) -> &PreparationSettings
Source§impl TransactionValidator
impl TransactionValidator
pub fn validate_notarized_v1( &self, transaction: PreparedNotarizedTransactionV1, ) -> Result<ValidatedNotarizedTransactionV1, TransactionValidationError>
pub fn validate_preview_intent_v1( &self, preview_intent: PreviewIntentV1, ) -> Result<ValidatedPreviewIntent, TransactionValidationError>
pub fn validate_intent_v1( &self, intent: &PreparedIntentV1, ) -> Result<AcrossIntentAggregation, IntentValidationError>
pub fn validate_instructions_v1( &self, instructions: &[InstructionV1], blobs: &IndexMap<Hash, Vec<u8>>, ) -> Result<(), IntentValidationError>
pub fn validate_instructions_basic_v1( &self, instructions: &[InstructionV1], ) -> Result<(), ManifestBasicValidatorError>
pub fn validate_header_v1( &self, header: &TransactionHeaderV1, ) -> Result<(), HeaderValidationError>
pub fn validate_message_v1( &self, message: &MessageV1, ) -> Result<(), InvalidMessageError>
Source§impl TransactionValidator
impl TransactionValidator
pub fn validate_notarized_v2( &self, prepared: PreparedNotarizedTransactionV2, ) -> Result<ValidatedNotarizedTransactionV2, TransactionValidationError>
pub fn validate_preview_transaction_v2( &self, prepared: PreparedPreviewTransactionV2, ) -> Result<ValidatedPreviewTransactionV2, TransactionValidationError>
pub fn validate_transaction_header_v2( &self, header: &TransactionHeaderV2, ) -> Result<(), HeaderValidationError>
pub fn validate_signed_partial_transaction_v2( &self, prepared: PreparedSignedPartialTransactionV2, ) -> Result<ValidatedSignedPartialTransactionV2, TransactionValidationError>
pub fn validate_transaction_tree_v2( &self, signed_intent_tree: &impl SignedIntentTreeStructure, root_intent_core: &PreparedIntentCoreV2, non_root_subintents: &PreparedNonRootSubintentsV2, ) -> Result<ValidatedTransactionTreeV2, TransactionValidationError>
pub fn validate_v2_intent_core( &self, intent_core: &PreparedIntentCoreV2, aggregation: &mut AcrossIntentAggregation, is_subintent: bool, ) -> Result<ManifestYieldSummary, IntentValidationError>
pub fn validate_intent_header_v2( &self, header: &IntentHeaderV2, aggregation: &mut AcrossIntentAggregation, ) -> Result<(), HeaderValidationError>
pub fn validate_message_v2( &self, message: &MessageV2, ) -> Result<(), InvalidMessageError>
Sourcepub fn validate_manifest_v2(
&self,
instructions: &[InstructionV2],
blobs: &IndexMap<Hash, Vec<u8>>,
children: &IndexSet<ChildSubintentSpecifier>,
is_subintent: bool,
) -> Result<ManifestYieldSummary, ManifestValidationError>
pub fn validate_manifest_v2( &self, instructions: &[InstructionV2], blobs: &IndexMap<Hash, Vec<u8>>, children: &IndexSet<ChildSubintentSpecifier>, is_subintent: bool, ) -> Result<ManifestYieldSummary, ManifestValidationError>
The is_subintent
property indicates whether it should be treated as a subintent.
A subintent is able to YIELD_TO_PARENT
and is required to end with a YIELD_TO_PARENT
.
Trait Implementations§
Source§impl Clone for TransactionValidator
impl Clone for TransactionValidator
Source§fn clone(&self) -> TransactionValidator
fn clone(&self) -> TransactionValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TransactionValidator
impl Debug for TransactionValidator
Source§impl PartialEq for TransactionValidator
impl PartialEq for TransactionValidator
impl Copy for TransactionValidator
impl Eq for TransactionValidator
impl StructuralPartialEq for TransactionValidator
Auto 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.