Simplify
This commit is contained in:
parent
d190008f2c
commit
683a817c55
19
src/lib.rs
19
src/lib.rs
@ -133,24 +133,7 @@ trait OfflineWalletOperations<B>: WalletHolder<B> {
|
|||||||
|
|
||||||
fn get_transactions(&self) -> Result<Vec<Transaction>, Error> {
|
fn get_transactions(&self) -> Result<Vec<Transaction>, Error> {
|
||||||
let transactions = self.get_wallet().list_transactions(true)?;
|
let transactions = self.get_wallet().list_transactions(true)?;
|
||||||
Ok(transactions
|
Ok(transactions.iter().map(to_transaction).collect())
|
||||||
.iter()
|
|
||||||
.map(|x| -> Transaction {
|
|
||||||
let details = TransactionDetails {
|
|
||||||
fees: x.fee,
|
|
||||||
id: x.txid.to_string(),
|
|
||||||
received: x.received,
|
|
||||||
sent: x.sent,
|
|
||||||
};
|
|
||||||
match x.confirmation_time.clone() {
|
|
||||||
Some(confirmation) => Transaction::Confirmed {
|
|
||||||
details,
|
|
||||||
confirmation,
|
|
||||||
},
|
|
||||||
None => Transaction::Unconfirmed { details },
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user