Trait runtime::ReplacePallet
source · pub trait ReplacePallet {
// Required methods
fn request_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
vault_id: &'life1 VaultId,
amount: u128
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn withdraw_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
vault_id: &'life1 VaultId,
amount: u128
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn accept_replace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
new_vault: &'life1 VaultId,
old_vault: &'life2 VaultId,
amount_btc: u128,
collateral: u128,
btc_address: BtcAddress
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn execute_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
replace_id: H256,
raw_proof: &'life1 RawTransactionProof
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn cancel_replace<'life0, 'async_trait>(
&'life0 self,
replace_id: H256
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_new_vault_replace_requests<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId
) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_old_vault_replace_requests<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId
) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_replace_period<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_replace_request<'life0, 'async_trait>(
&'life0 self,
replace_id: H256
) -> Pin<Box<dyn Future<Output = Result<InterBtcReplaceRequest, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_replace_dust_amount<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u128, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
sourcefn request_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
vault_id: &'life1 VaultId,
amount: u128
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request_replace<'life0, 'life1, 'async_trait>( &'life0 self, vault_id: &'life1 VaultId, amount: u128 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Request the replacement of a new vault ownership
Arguments
&self
- sender of the transactionamount
- amount of [Wrapped]
sourcefn withdraw_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
vault_id: &'life1 VaultId,
amount: u128
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn withdraw_replace<'life0, 'life1, 'async_trait>( &'life0 self, vault_id: &'life1 VaultId, amount: u128 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Withdraw a request of vault replacement
Arguments
&self
- sender of the transaction: the old vaultamount
- the amount of [Wrapped] to replace
sourcefn accept_replace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
new_vault: &'life1 VaultId,
old_vault: &'life2 VaultId,
amount_btc: u128,
collateral: u128,
btc_address: BtcAddress
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn accept_replace<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, new_vault: &'life1 VaultId, old_vault: &'life2 VaultId, amount_btc: u128, collateral: u128, btc_address: BtcAddress ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Accept request of vault replacement
Arguments
&self
- the initiator of the transaction: the new vaultold_vault
- the vault to replaceamount_btc
- the amount of [Wrapped] to replacecollateral
- the collateral for replacementbtc_address
- the address to send funds to
sourcefn execute_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
replace_id: H256,
raw_proof: &'life1 RawTransactionProof
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_replace<'life0, 'life1, 'async_trait>( &'life0 self, replace_id: H256, raw_proof: &'life1 RawTransactionProof ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Execute vault replacement
Arguments
&self
- sender of the transaction: the old vaultreplace_id
- the ID of the replacement requestraw_proof
- raw tx and proofs of coinbase and user tx
sourcefn cancel_replace<'life0, 'async_trait>(
&'life0 self,
replace_id: H256
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_replace<'life0, 'async_trait>( &'life0 self, replace_id: H256 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Cancel vault replacement
Arguments
&self
- sender of the transaction: the new vaultreplace_id
- the ID of the replacement request
sourcefn get_new_vault_replace_requests<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId
) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_new_vault_replace_requests<'life0, 'async_trait>( &'life0 self, account_id: AccountId ) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get all replace requests accepted by the given vault
sourcefn get_old_vault_replace_requests<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId
) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_old_vault_replace_requests<'life0, 'async_trait>( &'life0 self, account_id: AccountId ) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get all replace requests made by the given vault
sourcefn get_replace_period<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_replace_period<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get the time difference in number of blocks between when a replace request is created and required completion time by a vault
sourcefn get_replace_request<'life0, 'async_trait>(
&'life0 self,
replace_id: H256
) -> Pin<Box<dyn Future<Output = Result<InterBtcReplaceRequest, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_replace_request<'life0, 'async_trait>( &'life0 self, replace_id: H256 ) -> Pin<Box<dyn Future<Output = Result<InterBtcReplaceRequest, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get a replace request from storage