feat(bdk): changeset's Append impl checks that network is consistent

This commit is contained in:
志宇 2023-11-06 11:52:03 +08:00
parent 06a956ad20
commit 79b84bed0e
No known key found for this signature in database
GPG Key ID: F6345C9837C2BDE8

View File

@ -138,6 +138,10 @@ impl Append for ChangeSet {
Append::append(&mut self.chain, other.chain); Append::append(&mut self.chain, other.chain);
Append::append(&mut self.indexed_tx_graph, other.indexed_tx_graph); Append::append(&mut self.indexed_tx_graph, other.indexed_tx_graph);
if other.network.is_some() { if other.network.is_some() {
debug_assert!(
self.network.is_none() || self.network == other.network,
"network type must be consistent"
);
self.network = other.network; self.network = other.network;
} }
} }