mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Add is_confirmed with a TODO: Remove
Closes https://github.com/serai-dex/serai/issues/129.
This commit is contained in:
@@ -55,6 +55,9 @@ pub trait Coin {
|
||||
key: <Self::Curve as Curve>::G,
|
||||
) -> Result<Vec<Self::Output>, CoinError>;
|
||||
|
||||
// TODO: Remove
|
||||
async fn is_confirmed(&self, tx: &[u8], height: usize) -> Result<bool, CoinError>;
|
||||
|
||||
async fn prepare_send(
|
||||
&self,
|
||||
keys: FrostKeys<Self::Curve>,
|
||||
|
||||
@@ -147,6 +147,12 @@ impl Coin for Monero {
|
||||
)
|
||||
}
|
||||
|
||||
async fn is_confirmed(&self, tx: &[u8], height: usize) -> Result<bool, CoinError> {
|
||||
let tx_height =
|
||||
self.rpc.get_transaction_height(tx).await.map_err(|_| CoinError::ConnectionError)?;
|
||||
Ok((height.saturating_sub(tx_height) + 1) >= 10)
|
||||
}
|
||||
|
||||
async fn prepare_send(
|
||||
&self,
|
||||
keys: FrostKeys<Ed25519>,
|
||||
|
||||
Reference in New Issue
Block a user