Skip to content

Commit

Permalink
feat(wallet): make Wallet::insert_tx generic
Browse files Browse the repository at this point in the history
Instead of having `Transaction` as input, have
`T: Into<Arc<Transaction>>`.
  • Loading branch information
evanlinjin committed Sep 3, 2024
1 parent 5918d77 commit 4c3e0cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ impl Wallet {
/// By default the inserted `tx` won't be considered "canonical" because it's not known
/// whether the transaction exists in the best chain. To know whether it exists, the tx
/// must be broadcast to the network and the wallet synced via a chain source.
pub fn insert_tx(&mut self, tx: Transaction) -> bool {
pub fn insert_tx<T: Into<Arc<Transaction>>>(&mut self, tx: T) -> bool {
let mut changeset = ChangeSet::default();
changeset.merge(self.indexed_graph.insert_tx(tx).into());
let ret = !changeset.is_empty();
Expand Down

0 comments on commit 4c3e0cb

Please sign in to comment.