Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ impl<'de> Deserialize<'de> for TransferHeight {
}
}

/// Destinations for `GetTransferCategory::Out : true`
#[derive(Clone, Debug, Eq, PartialEq, Deserialize)]
pub struct Destination {
pub address: Address,
#[serde(with = "amount::serde::as_pico")]
pub amount: Amount,
}

/// Return type of wallet `get_transfer` and `get_transfers`.
#[derive(Clone, Debug, Eq, PartialEq, Deserialize)]
pub struct GotTransfer {
Expand All @@ -538,6 +546,8 @@ pub struct GotTransfer {
pub height: TransferHeight,
/// Note about this transfer.
pub note: String,
/// Destinations for this transfer
pub destinations: Option<Vec<Destination>>,
/// Payment ID for this transfer.
pub payment_id: HashString<PaymentId>,
/// JSON object containing the major & minor subaddress index.
Expand Down Expand Up @@ -634,7 +644,7 @@ mod tests {
orphan_status: true,
prev_hash: HashString(BlockHash::repeat_byte(12)),
reward: Amount::from_pico(12),
timestamp: DateTime::<Utc>::from_utc(
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(61, 0).unwrap(),
Utc,
),
Expand All @@ -653,7 +663,7 @@ mod tests {
orphan_status: true,
prev_hash: BlockHash::repeat_byte(12),
reward: Amount::from_pico(12),
timestamp: DateTime::<Utc>::from_utc(
timestamp: DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(61, 0).unwrap(),
Utc,
),
Expand Down
14 changes: 12 additions & 2 deletions tests/clients_tests/all_clients_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use monero::{
Address, Amount, Hash, KeyPair, Network, ViewPair,
};
use monero_rpc::{
BalanceData, BlockHeightFilter, GetTransfersCategory, GetTransfersSelector, GotTransfer,
HashString, IncomingTransfer, IncomingTransfers, KeyImageImportResponse, Payment,
BalanceData, BlockHeightFilter, Destination, GetTransfersCategory, GetTransfersSelector,
GotTransfer, HashString, IncomingTransfer, IncomingTransfers, KeyImageImportResponse, Payment,
PrivateKeyType, SubaddressBalanceData, SweepAllArgs, Transaction, TransactionsResponse,
TransferHeight, TransferOptions, TransferPriority, TransferType,
};
Expand Down Expand Up @@ -456,6 +456,16 @@ pub async fn run() {
txid: HashString(transfer_1_data.tx_hash.0.as_ref().to_vec()),
transfer_type: GetTransfersCategory::Pending,
unlock_time: 0,
destinations: Some(transfer_1_destination.clone().into_iter().fold(
vec![],
|mut acc, x| {
acc.push(Destination {
address: x.0,
amount: x.1,
});
acc
},
)),
});
helpers::wallet::get_transfer_assert_got_transfer(
&wallet,
Expand Down