pub struct CheckpointVerifier { /* private fields */ }Expand description
Checkpoint finality verifier for Aptos
Implementations§
Source§impl CheckpointVerifier
impl CheckpointVerifier
Sourcepub fn with_config(config: CheckpointConfig) -> Self
pub fn with_config(config: CheckpointConfig) -> Self
Create a new checkpoint verifier with custom configuration.
Sourcepub fn config(&self) -> &CheckpointConfig
pub fn config(&self) -> &CheckpointConfig
Get the verifier configuration.
Sourcepub fn is_version_finalized(
&self,
version: u64,
rpc: &dyn AptosRpc,
required_signatures: u64,
) -> AptosResult<CheckpointInfo>
pub fn is_version_finalized( &self, version: u64, rpc: &dyn AptosRpc, required_signatures: u64, ) -> AptosResult<CheckpointInfo>
Check if a transaction version is in a certified block.
In Aptos, a block is certified when it receives signatures from 2f+1 validators. Once certified, the block cannot be reverted.
§Arguments
version- The transaction version to checkrpc- RPC client for fetching block datarequired_signatures- Required number of validator signatures (2f+1)
§Returns
Ok(CheckpointInfo) with certification details, or Err on failure.
Sourcepub fn is_resource_present(
&self,
address: [u8; 32],
resource_type: &str,
rpc: &dyn AptosRpc,
) -> AptosResult<bool>
pub fn is_resource_present( &self, address: [u8; 32], resource_type: &str, rpc: &dyn AptosRpc, ) -> AptosResult<bool>
Check if a resource still exists (for seal verification).
This verifies that a seal resource has not been consumed yet.
§Arguments
address- The account addressresource_type- The resource type tagrpc- RPC client for fetching resource data
Sourcepub fn verify_event_in_transaction(
&self,
tx_version: u64,
expected_event_data: &[u8],
rpc: &dyn AptosRpc,
) -> AptosResult<bool>
pub fn verify_event_in_transaction( &self, tx_version: u64, expected_event_data: &[u8], rpc: &dyn AptosRpc, ) -> AptosResult<bool>
Verify an event was emitted in a specific transaction.
§Arguments
tx_version- The transaction version to checkexpected_event_data- The expected event data bytesrpc- RPC client for fetching transaction data
Sourcepub fn current_epoch(&self, rpc: &dyn AptosRpc) -> AptosResult<u64>
pub fn current_epoch(&self, rpc: &dyn AptosRpc) -> AptosResult<u64>
Sourcepub fn is_epoch_passed(
&self,
expected_epoch: u64,
rpc: &dyn AptosRpc,
) -> AptosResult<bool>
pub fn is_epoch_passed( &self, expected_epoch: u64, rpc: &dyn AptosRpc, ) -> AptosResult<bool>
Verify that an epoch boundary has passed.
This is useful for ensuring the network has progressed beyond a certain point.
§Arguments
expected_epoch- The epoch we expect the network to be inrpc- RPC client for fetching current epoch
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckpointVerifier
impl RefUnwindSafe for CheckpointVerifier
impl Send for CheckpointVerifier
impl Sync for CheckpointVerifier
impl Unpin for CheckpointVerifier
impl UnsafeUnpin for CheckpointVerifier
impl UnwindSafe for CheckpointVerifier
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