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:
Luke Parker
2024-07-12 04:14:05 -04:00
parent 32c24917c4
commit ba657e23d1
5 changed files with 83 additions and 36 deletions

View File

@@ -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);