sp_domains

Trait DomainsTransfersTracker

source
pub trait DomainsTransfersTracker<Balance> {
    type Error;

    // Required methods
    fn initialize_domain_balance(
        domain_id: DomainId,
        amount: Balance,
    ) -> Result<(), Self::Error>;
    fn note_transfer(
        from_chain_id: ChainId,
        to_chain_id: ChainId,
        amount: Balance,
    ) -> Result<(), Self::Error>;
    fn confirm_transfer(
        from_chain_id: ChainId,
        to_chain_id: ChainId,
        amount: Balance,
    ) -> Result<(), Self::Error>;
    fn claim_rejected_transfer(
        from_chain_id: ChainId,
        to_chain_id: ChainId,
        amount: Balance,
    ) -> Result<(), Self::Error>;
    fn reject_transfer(
        from_chain_id: ChainId,
        to_chain_id: ChainId,
        amount: Balance,
    ) -> Result<(), Self::Error>;
    fn reduce_domain_balance(
        domain_id: DomainId,
        amount: Balance,
    ) -> Result<(), Self::Error>;
}
Expand description

Trait that tracks the balances on Domains.

Required Associated Types§

Required Methods§

source

fn initialize_domain_balance( domain_id: DomainId, amount: Balance, ) -> Result<(), Self::Error>

Initializes the domain balance

source

fn note_transfer( from_chain_id: ChainId, to_chain_id: ChainId, amount: Balance, ) -> Result<(), Self::Error>

Notes a transfer between chains. Balance on from_chain_id is reduced if it is a domain chain

source

fn confirm_transfer( from_chain_id: ChainId, to_chain_id: ChainId, amount: Balance, ) -> Result<(), Self::Error>

Confirms a transfer between chains.

source

fn claim_rejected_transfer( from_chain_id: ChainId, to_chain_id: ChainId, amount: Balance, ) -> Result<(), Self::Error>

Claims a rejected transfer between chains.

source

fn reject_transfer( from_chain_id: ChainId, to_chain_id: ChainId, amount: Balance, ) -> Result<(), Self::Error>

Rejects a initiated transfer between chains.

source

fn reduce_domain_balance( domain_id: DomainId, amount: Balance, ) -> Result<(), Self::Error>

Reduces a given amount from the domain balance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§