mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Write a test runner for Monero transactions
Also includes a few fixes for the library itself. Supersedes #172.
This commit is contained in:
@@ -27,7 +27,7 @@ pub struct JsonRpcResponse<T> {
|
||||
#[derive(Deserialize, Debug)]
|
||||
struct TransactionResponse {
|
||||
tx_hash: String,
|
||||
block_height: usize,
|
||||
block_height: Option<usize>,
|
||||
as_hex: String,
|
||||
pruned_as_hex: String,
|
||||
}
|
||||
@@ -274,7 +274,7 @@ impl Rpc {
|
||||
self.get_transactions(&[tx]).await.map(|mut txs| txs.swap_remove(0))
|
||||
}
|
||||
|
||||
pub async fn get_transaction_block_number(&self, tx: &[u8]) -> Result<usize, RpcError> {
|
||||
pub async fn get_transaction_block_number(&self, tx: &[u8]) -> Result<Option<usize>, RpcError> {
|
||||
let txs: TransactionsResponse =
|
||||
self.rpc_call("get_transactions", Some(json!({ "txs_hashes": [hex::encode(tx)] }))).await?;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ pub mod address;
|
||||
use address::{Network, AddressType, AddressMeta, MoneroAddress};
|
||||
|
||||
mod scan;
|
||||
pub use scan::SpendableOutput;
|
||||
pub use scan::{ReceivedOutput, SpendableOutput};
|
||||
|
||||
pub(crate) mod decoys;
|
||||
pub(crate) use decoys::Decoys;
|
||||
|
||||
@@ -362,7 +362,7 @@ impl SignableTransaction {
|
||||
|
||||
/// Sign this transaction.
|
||||
pub async fn sign<R: RngCore + CryptoRng>(
|
||||
&mut self,
|
||||
mut self,
|
||||
rng: &mut R,
|
||||
rpc: &Rpc,
|
||||
spend: &Zeroizing<Scalar>,
|
||||
|
||||
Reference in New Issue
Block a user