Skip to content

Commit 79b84be

Browse files
committed
feat(bdk): changeset's Append impl checks that network is consistent
1 parent 06a956a commit 79b84be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bdk/src/wallet/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ impl Append for ChangeSet {
138138
Append::append(&mut self.chain, other.chain);
139139
Append::append(&mut self.indexed_tx_graph, other.indexed_tx_graph);
140140
if other.network.is_some() {
141+
debug_assert!(
142+
self.network.is_none() || self.network == other.network,
143+
"network type must be consistent"
144+
);
141145
self.network = other.network;
142146
}
143147
}

0 commit comments

Comments
 (0)