From c39284d8299c5a8b34b73ce947e93425d5cdc121 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BF=97=E5=AE=87?= Date: Tue, 3 Sep 2024 13:18:20 +0800 Subject: [PATCH] feat(wallet): make `Wallet::insert_tx` generic Instead of having `Transaction` as input, have `T: Into>`. --- crates/wallet/src/wallet/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wallet/src/wallet/mod.rs b/crates/wallet/src/wallet/mod.rs index 5cad6bb8..8513251a 100644 --- a/crates/wallet/src/wallet/mod.rs +++ b/crates/wallet/src/wallet/mod.rs @@ -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>>(&mut self, tx: T) -> bool { let mut changeset = ChangeSet::default(); changeset.merge(self.indexed_graph.insert_tx(tx).into()); let ret = !changeset.is_empty(); -- 2.49.0