Finish merging in the develop branch

This commit is contained in:
Luke Parker
2025-01-30 03:14:24 -05:00
parent 258c02ff39
commit a275023cfc
62 changed files with 452 additions and 508 deletions

View File

@@ -8,7 +8,7 @@ use scale::{Encode, Decode};
use borsh::{BorshSerialize, BorshDeserialize};
use serai_client::{
primitives::{Coin, Amount, Balance},
primitives::{ExternalCoin, Amount, ExternalBalance},
networks::monero::Address,
};
@@ -76,8 +76,8 @@ impl ReceivedOutput<<Ed25519 as Ciphersuite>::G, Address> for Output {
None
}
fn balance(&self) -> Balance {
Balance { coin: Coin::Monero, amount: Amount(self.0.commitment().amount) }
fn balance(&self) -> ExternalBalance {
ExternalBalance { coin: ExternalCoin::Monero, amount: Amount(self.0.commitment().amount) }
}
fn data(&self) -> &[u8] {

View File

@@ -3,7 +3,7 @@ use core::future::Future;
use monero_wallet::rpc::{RpcError, Rpc as RpcTrait};
use monero_simple_request_rpc::SimpleRequestRpc;
use serai_client::primitives::{NetworkId, Coin, Amount};
use serai_client::primitives::{ExternalNetworkId, ExternalCoin, Amount};
use scanner::ScannerFeed;
use signers::TransactionPublisher;
@@ -19,7 +19,7 @@ pub(crate) struct Rpc {
}
impl ScannerFeed for Rpc {
const NETWORK: NetworkId = NetworkId::Monero;
const NETWORK: ExternalNetworkId = ExternalNetworkId::Monero;
// Outputs aren't spendable until 10 blocks later due to the 10-block lock
// Since we assumed scanned outputs are spendable, that sets a minimum confirmation depth of 10
// A 10-block reorganization hasn't been observed in years and shouldn't occur
@@ -107,8 +107,8 @@ impl ScannerFeed for Rpc {
}
}
fn dust(coin: Coin) -> Amount {
assert_eq!(coin, Coin::Monero);
fn dust(coin: ExternalCoin) -> Amount {
assert_eq!(coin, ExternalCoin::Monero);
// 0.01 XMR
Amount(10_000_000_000)
@@ -116,11 +116,11 @@ impl ScannerFeed for Rpc {
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))
}

View File

@@ -9,7 +9,7 @@ use ciphersuite::{Ciphersuite, Ed25519};
use monero_wallet::rpc::{FeeRate, RpcError};
use serai_client::{
primitives::{Coin, Amount},
primitives::{ExternalCoin, Amount},
networks::monero::Address,
};
@@ -106,7 +106,7 @@ async fn signable_transaction(
.map(|payment| {
(MoneroAddress::from(*payment.address()), {
let balance = payment.balance();
assert_eq!(balance.coin, Coin::Monero);
assert_eq!(balance.coin, ExternalCoin::Monero);
balance.amount.0
})
})