Merge bitcoindevkit/bdk#633: Additional comments for TransactionDetails.

77c7d0aae944dbd5a44ca9b8f239db0c9edcd4f8 Additional comments for `TransactionDetails`. (志宇)

Pull request description:

  ### Description

  I'm not sure if this is needed or helpful, but this PR adds comments to describe how the `sent` and `received` fields of `TransactionDetails` are calculated.

  I wasn't sure how it was done until I looked deeper into the codebase (but maybe I am too much of a beginner and this is common sense for most).

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  danielabrozzoni:
    re-ACK 77c7d0aae944dbd5a44ca9b8f239db0c9edcd4f8

Tree-SHA512: 8d29d249a70bc2d0631078b6772c5543bdc61ee43df3810ab666f5e97ca59b0d4cfc8acad14bbaf8674baba319f24fa2781a42740ca42bccd9688831aaedea72
This commit is contained in:
Alekos Filini 2022-06-29 15:52:37 +02:00
commit f184557fa0
No known key found for this signature in database
GPG Key ID: 431401E4A4530061

View File

@ -202,8 +202,10 @@ pub struct TransactionDetails {
pub txid: Txid,
/// Received value (sats)
/// Sum of owned outputs of this transaction.
pub received: u64,
/// Sent value (sats)
/// Sum of owned inputs of this transaction.
pub sent: u64,
/// Fee value (sats) if available.
/// The availability of the fee depends on the backend. It's never `None` with an Electrum