pub struct CrossChainRegistry { /* private fields */ }Expand description
Cross-chain seal registry.
Tracks all cross-chain transfers to prevent double-spends.
Implementations§
Source§impl CrossChainRegistry
impl CrossChainRegistry
Sourcepub fn record_transfer(
&mut self,
entry: CrossChainRegistryEntry,
) -> Result<(), CrossChainError>
pub fn record_transfer( &mut self, entry: CrossChainRegistryEntry, ) -> Result<(), CrossChainError>
Record a cross-chain transfer.
Sourcepub fn is_right_transferred(&self, right_id: &Hash) -> bool
pub fn is_right_transferred(&self, right_id: &Hash) -> bool
Check if a Right has already been transferred.
Sourcepub fn is_seal_consumed(&self, seal: &SealRef) -> bool
pub fn is_seal_consumed(&self, seal: &SealRef) -> bool
Check if a source seal has already been consumed.
Sourcepub fn get_entry(&self, right_id: &Hash) -> Option<&CrossChainRegistryEntry>
pub fn get_entry(&self, right_id: &Hash) -> Option<&CrossChainRegistryEntry>
Get the registry entry for a Right.
Sourcepub fn transfer_count(&self) -> usize
pub fn transfer_count(&self) -> usize
Get the number of recorded transfers.
Sourcepub fn all_transfers(&self) -> Vec<&CrossChainRegistryEntry>
pub fn all_transfers(&self) -> Vec<&CrossChainRegistryEntry>
Get all recorded transfers.
Trait Implementations§
Source§impl Default for CrossChainRegistry
impl Default for CrossChainRegistry
Source§fn default() -> CrossChainRegistry
fn default() -> CrossChainRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CrossChainRegistry
impl RefUnwindSafe for CrossChainRegistry
impl Send for CrossChainRegistry
impl Sync for CrossChainRegistry
impl Unpin for CrossChainRegistry
impl UnsafeUnpin for CrossChainRegistry
impl UnwindSafe for CrossChainRegistry
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