From 79b84bed0ec399a375490c2c0f16c6ea3f5969b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Mon, 6 Nov 2023 11:52:03 +0800 Subject: [PATCH] feat(bdk): changeset's `Append` impl checks that network is consistent --- crates/bdk/src/wallet/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bdk/src/wallet/mod.rs b/crates/bdk/src/wallet/mod.rs index c9a1c28cb..e396b8d4f 100644 --- a/crates/bdk/src/wallet/mod.rs +++ b/crates/bdk/src/wallet/mod.rs @@ -138,6 +138,10 @@ impl Append for ChangeSet { Append::append(&mut self.chain, other.chain); Append::append(&mut self.indexed_tx_graph, other.indexed_tx_graph); if other.network.is_some() { + debug_assert!( + self.network.is_none() || self.network == other.network, + "network type must be consistent" + ); self.network = other.network; } }