mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 21:49:26 +00:00
Smash out RPC, wallet
This commit is contained in:
@@ -27,7 +27,8 @@ rand_core = { version = "0.6", default-features = false }
|
||||
curve25519-dalek = { version = "4", features = ["rand_core"] }
|
||||
|
||||
bitcoin-serai = { path = "../../coins/bitcoin" }
|
||||
monero-serai = { path = "../../coins/monero" }
|
||||
monero-simple-request-rpc = { path = "../../coins/monero/rpc/simple-request" }
|
||||
monero-wallet = { path = "../../coins/monero/wallet" }
|
||||
|
||||
scale = { package = "parity-scale-codec", version = "3" }
|
||||
serde = "1"
|
||||
|
||||
@@ -53,8 +53,8 @@ impl Handles {
|
||||
pub async fn monero(
|
||||
&self,
|
||||
ops: &DockerOperations,
|
||||
) -> monero_serai::rpc::Rpc<monero_serai::rpc::HttpRpc> {
|
||||
use monero_serai::rpc::HttpRpc;
|
||||
) -> monero_wallet::rpc::Rpc<monero_simple_request_rpc::SimpleRequestRpc> {
|
||||
use monero_simple_request_rpc::SimpleRequestRpc;
|
||||
|
||||
let rpc = ops.handle(&self.monero.0).host_port(self.monero.1).unwrap();
|
||||
let rpc = format!("http://{RPC_USER}:{RPC_PASS}@{}:{}", rpc.0, rpc.1);
|
||||
@@ -62,7 +62,7 @@ impl Handles {
|
||||
// If the RPC server has yet to start, sleep for up to 60s until it does
|
||||
for _ in 0 .. 60 {
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
let Ok(client) = HttpRpc::new(rpc.clone()).await else { continue };
|
||||
let Ok(client) = SimpleRequestRpc::new(rpc.clone()).await else { continue };
|
||||
if client.get_height().await.is_err() {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ async fn mint_and_burn_test() {
|
||||
// Mine a Monero block
|
||||
let monero_blocks = {
|
||||
use curve25519_dalek::{constants::ED25519_BASEPOINT_POINT, scalar::Scalar};
|
||||
use monero_serai::wallet::{
|
||||
use monero_wallet::{
|
||||
ViewPair,
|
||||
address::{Network, AddressSpec},
|
||||
};
|
||||
@@ -345,14 +345,10 @@ async fn mint_and_burn_test() {
|
||||
// Send in XMR
|
||||
{
|
||||
use curve25519_dalek::{constants::ED25519_BASEPOINT_POINT, scalar::Scalar};
|
||||
use monero_serai::{
|
||||
Protocol,
|
||||
transaction::Timelock,
|
||||
wallet::{
|
||||
ViewPair, Scanner, DecoySelection, Decoys, Change, FeePriority, SignableTransaction,
|
||||
address::{Network, AddressType, AddressMeta, MoneroAddress},
|
||||
},
|
||||
io::decompress_point,
|
||||
use monero_wallet::{
|
||||
monero::{io::decompress_point, Protocol, transaction::Timelock},
|
||||
ViewPair, Scanner, DecoySelection, Decoys, Change, FeePriority, SignableTransaction,
|
||||
address::{Network, AddressType, AddressMeta, MoneroAddress},
|
||||
};
|
||||
|
||||
// Grab the first output on the chain
|
||||
@@ -473,7 +469,7 @@ async fn mint_and_burn_test() {
|
||||
let spend = ED25519_BASEPOINT_TABLE * &Scalar::random(&mut OsRng);
|
||||
let view = Scalar::random(&mut OsRng);
|
||||
|
||||
use monero_serai::wallet::address::{Network, AddressType, AddressMeta, MoneroAddress};
|
||||
use monero_wallet::address::{Network, AddressType, AddressMeta, MoneroAddress};
|
||||
let addr = MoneroAddress::new(
|
||||
AddressMeta::new(Network::Mainnet, AddressType::Standard),
|
||||
spend,
|
||||
@@ -578,7 +574,7 @@ async fn mint_and_burn_test() {
|
||||
|
||||
// Verify the received Monero TX
|
||||
{
|
||||
use monero_serai::wallet::{ViewPair, Scanner};
|
||||
use monero_wallet::{ViewPair, Scanner};
|
||||
let rpc = handles[0].monero(&ops).await;
|
||||
let mut scanner = Scanner::from_view(
|
||||
ViewPair::new(monero_spend, Zeroizing::new(monero_view)),
|
||||
|
||||
Reference in New Issue
Block a user