Skip to content

Commit 5698663

Browse files
authored
Merge pull request rust-bitcoin#82 from tcharding/03-10-get-transaction
Use `SignedAmount` when converting `gettransaction` amount to model
2 parents 10d5a5c + 164cbe2 commit 5698663

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

types/src/model/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub struct GetReceivedByAddress(pub Amount);
283283
pub struct GetTransaction {
284284
/// The transaction amount.
285285
#[serde(default, with = "bitcoin::amount::serde::as_btc")]
286-
pub amount: Amount,
286+
pub amount: SignedAmount,
287287
/// The amount of the fee.
288288
///
289289
/// This is negative and only available for the 'send' category of transactions.

types/src/v17/wallet/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl GetTransaction {
328328
pub fn into_model(self) -> Result<model::GetTransaction, GetTransactionError> {
329329
use GetTransactionError as E;
330330

331-
let amount = Amount::from_btc(self.amount).map_err(E::Amount)?;
331+
let amount = SignedAmount::from_btc(self.amount).map_err(E::Amount)?;
332332
let fee = self.fee.map(|fee| SignedAmount::from_btc(fee).map_err(E::Fee)).transpose()?;
333333

334334
let block_hash =

types/src/v17/wallet/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use self::error::*;
2121
//
2222
// The following structs are very similar but have slightly different fields and docs.
2323
// - GetTransaction
24-
// - ListSinceLastBlockTransaction
24+
// - ListSinceBlockTransaction
2525
// - ListTransactionsItem
2626

2727
/// Returned as part of `getaddressesbylabel` and `getaddressinfo`

0 commit comments

Comments
 (0)