mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
Have a public monero-rpc type be properly formatted
It was public as the raw RPC response. It's more polite to handle the formatting in the RPC, and allows us to return a better structure.
This commit is contained in:
@@ -65,7 +65,6 @@ impl AddressType {
|
||||
}
|
||||
|
||||
/// The payment ID within this address.
|
||||
// TODO: wallet-core PaymentId? TX extra crate imported here?
|
||||
pub fn payment_id(&self) -> Option<[u8; 8]> {
|
||||
if let AddressType::LegacyIntegrated(id) = self {
|
||||
Some(*id)
|
||||
|
||||
@@ -102,7 +102,6 @@ impl SharedKeyDerivations {
|
||||
}
|
||||
|
||||
// H(8Ra || 0x8d)
|
||||
// TODO: Make this itself a PaymentId
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
fn payment_id_xor(ecdh: Zeroizing<EdwardsPoint>) -> [u8; 8] {
|
||||
// 8Ra
|
||||
|
||||
@@ -2,7 +2,7 @@ use monero_simple_request_rpc::SimpleRequestRpc;
|
||||
use monero_wallet::{
|
||||
DEFAULT_LOCK_WINDOW,
|
||||
transaction::Transaction,
|
||||
rpc::{OutputResponse, Rpc, DecoyRpc},
|
||||
rpc::{Rpc, DecoyRpc},
|
||||
WalletOutput,
|
||||
};
|
||||
|
||||
@@ -54,8 +54,7 @@ test!(
|
||||
let most_recent_o_index = rpc.get_o_indexes(tx.hash()).await.unwrap().pop().unwrap();
|
||||
|
||||
// Make sure output from tx1 is in the block in which it unlocks
|
||||
let out_tx1: OutputResponse =
|
||||
rpc.get_outs(&[most_recent_o_index]).await.unwrap().swap_remove(0);
|
||||
let out_tx1 = rpc.get_outs(&[most_recent_o_index]).await.unwrap().swap_remove(0);
|
||||
assert_eq!(out_tx1.height, height - DEFAULT_LOCK_WINDOW);
|
||||
assert!(out_tx1.unlocked);
|
||||
|
||||
@@ -133,8 +132,7 @@ test!(
|
||||
let most_recent_o_index = rpc.get_o_indexes(tx.hash()).await.unwrap().pop().unwrap();
|
||||
|
||||
// Make sure output from tx1 is in the block in which it unlocks
|
||||
let out_tx1: OutputResponse =
|
||||
rpc.get_outs(&[most_recent_o_index]).await.unwrap().swap_remove(0);
|
||||
let out_tx1 = rpc.get_outs(&[most_recent_o_index]).await.unwrap().swap_remove(0);
|
||||
assert_eq!(out_tx1.height, height - DEFAULT_LOCK_WINDOW);
|
||||
assert!(out_tx1.unlocked);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user