mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Finish merging in the develop branch
This commit is contained in:
@@ -90,7 +90,7 @@ use bitcoin_serai::bitcoin::{
|
||||
};
|
||||
|
||||
use serai_client::{
|
||||
primitives::{MAX_DATA_LEN, Coin, NetworkId, Amount, Balance},
|
||||
primitives::{MAX_DATA_LEN, ExternalNetworkId, ExternalCoin, Amount, Balance},
|
||||
networks::bitcoin::Address,
|
||||
};
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ use borsh::{BorshSerialize, BorshDeserialize};
|
||||
use serai_db::Get;
|
||||
|
||||
use serai_client::{
|
||||
primitives::{Coin, Amount, Balance, ExternalAddress},
|
||||
primitives::{ExternalCoin, Amount, ExternalBalance, ExternalAddress},
|
||||
networks::bitcoin::Address,
|
||||
};
|
||||
|
||||
@@ -127,8 +127,8 @@ impl ReceivedOutput<<Secp256k1 as Ciphersuite>::G, Address> for Output {
|
||||
self.presumed_origin.clone()
|
||||
}
|
||||
|
||||
fn balance(&self) -> Balance {
|
||||
Balance { coin: Coin::Bitcoin, amount: Amount(self.output.value()) }
|
||||
fn balance(&self) -> ExternalBalance {
|
||||
ExternalBalance { coin: ExternalCoin::Bitcoin, amount: Amount(self.output.value()) }
|
||||
}
|
||||
|
||||
fn data(&self) -> &[u8] {
|
||||
|
||||
@@ -2,7 +2,7 @@ use core::future::Future;
|
||||
|
||||
use bitcoin_serai::rpc::{RpcError, Rpc as BRpc};
|
||||
|
||||
use serai_client::primitives::{NetworkId, Coin, Amount};
|
||||
use serai_client::primitives::{ExternalNetworkId, ExternalCoin, Amount};
|
||||
|
||||
use serai_db::Db;
|
||||
use scanner::ScannerFeed;
|
||||
@@ -21,7 +21,7 @@ pub(crate) struct Rpc<D: Db> {
|
||||
}
|
||||
|
||||
impl<D: Db> ScannerFeed for Rpc<D> {
|
||||
const NETWORK: NetworkId = NetworkId::Bitcoin;
|
||||
const NETWORK: ExternalNetworkId = ExternalNetworkId::Bitcoin;
|
||||
// 6 confirmations is widely accepted as secure and shouldn't occur
|
||||
const CONFIRMATIONS: u64 = 6;
|
||||
// The window length should be roughly an hour
|
||||
@@ -118,8 +118,8 @@ impl<D: Db> ScannerFeed for Rpc<D> {
|
||||
}
|
||||
}
|
||||
|
||||
fn dust(coin: Coin) -> Amount {
|
||||
assert_eq!(coin, Coin::Bitcoin);
|
||||
fn dust(coin: ExternalCoin) -> Amount {
|
||||
assert_eq!(coin, ExternalCoin::Bitcoin);
|
||||
|
||||
/*
|
||||
A Taproot input is:
|
||||
@@ -158,11 +158,11 @@ impl<D: Db> ScannerFeed for Rpc<D> {
|
||||
|
||||
fn cost_to_aggregate(
|
||||
&self,
|
||||
coin: Coin,
|
||||
coin: ExternalCoin,
|
||||
_reference_block: &Self::Block,
|
||||
) -> impl Send + Future<Output = Result<Amount, Self::EphemeralError>> {
|
||||
async move {
|
||||
assert_eq!(coin, Coin::Bitcoin);
|
||||
assert_eq!(coin, ExternalCoin::Bitcoin);
|
||||
// TODO
|
||||
Ok(Amount(0))
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use bitcoin_serai::{
|
||||
};
|
||||
|
||||
use serai_client::{
|
||||
primitives::{Coin, Amount},
|
||||
primitives::{ExternalCoin, Amount},
|
||||
networks::bitcoin::Address,
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ fn signable_transaction<D: Db>(
|
||||
.map(|payment| {
|
||||
(ScriptBuf::from(payment.address().clone()), {
|
||||
let balance = payment.balance();
|
||||
assert_eq!(balance.coin, Coin::Bitcoin);
|
||||
assert_eq!(balance.coin, ExternalCoin::Bitcoin);
|
||||
balance.amount.0
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user