mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 05:59:23 +00:00
Move Protocol to monero-wallet
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use monero_simple_request_rpc::SimpleRequestRpc;
|
||||
use monero_wallet::{
|
||||
monero::{transaction::Transaction, Protocol, DEFAULT_LOCK_WINDOW},
|
||||
monero::{transaction::Transaction, DEFAULT_LOCK_WINDOW},
|
||||
rpc::{OutputResponse, Rpc},
|
||||
SpendableOutput,
|
||||
};
|
||||
|
||||
@@ -109,9 +109,6 @@ pub async fn rpc() -> SimpleRequestRpc {
|
||||
// Mine 40 blocks to ensure decoy availability
|
||||
rpc.generate_blocks(&addr, 40).await.unwrap();
|
||||
|
||||
// Make sure we recognize the protocol
|
||||
rpc.get_protocol().await.unwrap();
|
||||
|
||||
rpc
|
||||
}
|
||||
|
||||
@@ -171,6 +168,7 @@ macro_rules! test {
|
||||
};
|
||||
|
||||
use monero_wallet::{
|
||||
Protocol,
|
||||
address::{Network, AddressSpec},
|
||||
ViewPair, Scanner, Change, DecoySelection, Decoys, FeePriority,
|
||||
SignableTransaction, SignableTransactionBuilder,
|
||||
@@ -212,11 +210,11 @@ macro_rules! test {
|
||||
|
||||
let miner_tx = get_miner_tx_output(&rpc, &view).await;
|
||||
|
||||
let protocol = rpc.get_protocol().await.unwrap();
|
||||
let protocol = Protocol::try_from(rpc.get_protocol().await.unwrap()).unwrap();
|
||||
|
||||
let builder = SignableTransactionBuilder::new(
|
||||
protocol,
|
||||
rpc.get_fee_rate(protocol, FeePriority::Unimportant).await.unwrap(),
|
||||
rpc.get_fee_rate(FeePriority::Unimportant).await.unwrap(),
|
||||
Change::new(
|
||||
&ViewPair::new(
|
||||
&Scalar::random(&mut OsRng) * ED25519_BASEPOINT_TABLE,
|
||||
|
||||
@@ -2,10 +2,7 @@ use rand_core::OsRng;
|
||||
|
||||
use monero_simple_request_rpc::SimpleRequestRpc;
|
||||
use monero_wallet::{
|
||||
monero::{transaction::Transaction, Protocol},
|
||||
rpc::Rpc,
|
||||
extra::Extra,
|
||||
address::SubaddressIndex,
|
||||
monero::transaction::Transaction, Protocol, rpc::Rpc, extra::Extra, address::SubaddressIndex,
|
||||
ReceivedOutput, SpendableOutput, DecoySelection, Decoys, SignableTransactionBuilder,
|
||||
};
|
||||
|
||||
@@ -109,7 +106,7 @@ test!(
|
||||
|
||||
let mut builder = SignableTransactionBuilder::new(
|
||||
protocol,
|
||||
rpc.get_fee_rate(protocol, FeePriority::Unimportant).await.unwrap(),
|
||||
rpc.get_fee_rate(FeePriority::Unimportant).await.unwrap(),
|
||||
Change::new(&change_view, false),
|
||||
);
|
||||
add_inputs(protocol, &rpc, vec![outputs.first().unwrap().clone()], &mut builder).await;
|
||||
@@ -293,7 +290,7 @@ test!(
|
||||
|
||||
let mut builder = SignableTransactionBuilder::new(
|
||||
protocol,
|
||||
rpc.get_fee_rate(protocol, FeePriority::Unimportant).await.unwrap(),
|
||||
rpc.get_fee_rate(FeePriority::Unimportant).await.unwrap(),
|
||||
Change::fingerprintable(None),
|
||||
);
|
||||
add_inputs(protocol, &rpc, vec![outputs.first().unwrap().clone()], &mut builder).await;
|
||||
|
||||
@@ -92,7 +92,7 @@ async fn from_wallet_rpc_to_self(spec: AddressSpec) {
|
||||
|
||||
// TODO: Needs https://github.com/monero-project/monero/pull/9260
|
||||
// let fee_rate = daemon_rpc
|
||||
// .get_fee_rate(daemon_rpc.get_protocol().await.unwrap(), FeePriority::Unimportant)
|
||||
// .get_fee_rate(FeePriority::Unimportant)
|
||||
// .await
|
||||
// .unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user