Merge branch 'develop' into next

This is an initial resolution of conflicts which does not work.
This commit is contained in:
Luke Parker
2025-01-30 00:56:29 -05:00
128 changed files with 1835 additions and 44261 deletions

View File

@@ -35,17 +35,17 @@ fn test_batch_signer() {
let block = BlockHash([0xaa; 32]);
let batch = Batch {
network: NetworkId::Monero,
network: ExternalNetworkId::Monero,
id,
block,
instructions: vec![
InInstructionWithBalance {
instruction: InInstruction::Transfer(SeraiAddress([0xbb; 32])),
balance: Balance { coin: Coin::Bitcoin, amount: Amount(1000) },
balance: ExternalBalance { coin: ExternalCoin::Bitcoin, amount: Amount(1000) },
},
InInstructionWithBalance {
instruction: InInstruction::Dex(DexCall::SwapAndAddLiquidity(SeraiAddress([0xbb; 32]))),
balance: Balance { coin: Coin::Monero, amount: Amount(9999999999999999) },
balance: ExternalBalance { coin: ExternalCoin::Monero, amount: Amount(9999999999999999) },
},
],
};
@@ -72,7 +72,7 @@ fn test_batch_signer() {
let i = Participant::new(u16::try_from(i).unwrap()).unwrap();
let keys = keys.get(&i).unwrap().clone();
let mut signer = BatchSigner::<MemDb>::new(NetworkId::Monero, Session(0), vec![keys]);
let mut signer = BatchSigner::<MemDb>::new(ExternalNetworkId::Monero, Session(0), vec![keys]);
let mut db = MemDb::new();
let mut txn = db.txn();

View File

@@ -398,7 +398,7 @@ mod ethereum {
let deployer = Deployer::new(provider.clone()).await.unwrap().unwrap();
let mut tx = deployer.deploy_router(&key);
tx.gas_limit = 1_000_000u64.into();
tx.gas_limit = 1_000_000u64;
tx.gas_price = 1_000_000_000u64.into();
let tx = ethereum_serai::crypto::deterministically_sign(&tx);

View File

@@ -14,7 +14,7 @@ use frost::{
use serai_db::{DbTxn, Db, MemDb};
use serai_client::{
primitives::{NetworkId, Coin, Amount, Balance},
primitives::{ExternalNetworkId, ExternalCoin, Amount, ExternalBalance},
validator_sets::primitives::Session,
};
@@ -186,12 +186,11 @@ pub async fn test_signer<N: Network>(
let mut scheduler = N::Scheduler::new::<MemDb>(&mut txn, key, N::NETWORK);
let payments = vec![Payment {
address: N::external_address(&network, key).await,
balance: Balance {
balance: ExternalBalance {
coin: match N::NETWORK {
NetworkId::Serai => panic!("test_signer called with Serai"),
NetworkId::Bitcoin => Coin::Bitcoin,
NetworkId::Ethereum => Coin::Ether,
NetworkId::Monero => Coin::Monero,
ExternalNetworkId::Bitcoin => ExternalCoin::Bitcoin,
ExternalNetworkId::Ethereum => ExternalCoin::Ether,
ExternalNetworkId::Monero => ExternalCoin::Monero,
},
amount: Amount(amount),
},
@@ -225,7 +224,7 @@ pub async fn test_signer<N: Network>(
.await;
// Don't run if Ethereum as the received output will revert by the contract
// (and therefore not actually exist)
if N::NETWORK != NetworkId::Ethereum {
if N::NETWORK != ExternalNetworkId::Ethereum {
assert_eq!(outputs.len(), 1 + usize::from(u8::from(plan.change.is_some())));
// Adjust the amount for the fees
let amount = amount - tx.fee(&network).await;

View File

@@ -13,7 +13,7 @@ use tokio::time::timeout;
use serai_db::{DbTxn, Db, MemDb};
use serai_client::{
primitives::{NetworkId, Coin, Amount, Balance},
primitives::{ExternalNetworkId, ExternalCoin, Amount, ExternalBalance},
validator_sets::primitives::Session,
};
@@ -90,12 +90,11 @@ pub async fn test_wallet<N: Network>(
outputs.clone(),
vec![Payment {
address: N::external_address(&network, key).await,
balance: Balance {
balance: ExternalBalance {
coin: match N::NETWORK {
NetworkId::Serai => panic!("test_wallet called with Serai"),
NetworkId::Bitcoin => Coin::Bitcoin,
NetworkId::Ethereum => Coin::Ether,
NetworkId::Monero => Coin::Monero,
ExternalNetworkId::Bitcoin => ExternalCoin::Bitcoin,
ExternalNetworkId::Ethereum => ExternalCoin::Ether,
ExternalNetworkId::Monero => ExternalCoin::Monero,
},
amount: Amount(amount),
},
@@ -117,12 +116,11 @@ pub async fn test_wallet<N: Network>(
plans[0].payments,
vec![Payment {
address: N::external_address(&network, key).await,
balance: Balance {
balance: ExternalBalance {
coin: match N::NETWORK {
NetworkId::Serai => panic!("test_wallet called with Serai"),
NetworkId::Bitcoin => Coin::Bitcoin,
NetworkId::Ethereum => Coin::Ether,
NetworkId::Monero => Coin::Monero,
ExternalNetworkId::Bitcoin => ExternalCoin::Bitcoin,
ExternalNetworkId::Ethereum => ExternalCoin::Ether,
ExternalNetworkId::Monero => ExternalCoin::Monero,
},
amount: Amount(amount),
}
@@ -160,7 +158,7 @@ pub async fn test_wallet<N: Network>(
// Don't run if Ethereum as the received output will revert by the contract
// (and therefore not actually exist)
if N::NETWORK != NetworkId::Ethereum {
if N::NETWORK != ExternalNetworkId::Ethereum {
assert_eq!(outputs.len(), 1 + usize::from(u8::from(plans[0].change.is_some())));
// Adjust the amount for the fees
let amount = amount - tx.fee(&network).await;
@@ -183,7 +181,7 @@ pub async fn test_wallet<N: Network>(
network.mine_block().await;
}
if N::NETWORK != NetworkId::Ethereum {
if N::NETWORK != ExternalNetworkId::Ethereum {
match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() {
ScannerEvent::Block { is_retirement_block, block: block_id, outputs: these_outputs } => {
scanner.multisig_completed.send(false).unwrap();