Skip to content

Commit

Permalink
add sync in revert_genesis to show unhandled reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedberg committed Jan 6, 2025
1 parent 9e2de76 commit 5020765
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/transfers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,11 @@ fn revert_genesis(#[case] with_transfers: bool) {
wlt.switch_to_instance(INSTANCE_3);
assert_eq!(wlt.get_witness_ord(&utxo.txid), WitnessOrd::Archived);

// this should remove the utxo that is now archived but it doesn't
wlt.sync();
let utxos = wlt.utxos();
assert!(utxos.is_empty());

wlt.check_allocations(
contract_id,
&iface_type_name,
Expand Down
4 changes: 4 additions & 0 deletions tests/utils/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,10 @@ impl TestWallet {
self.wallet.stock().contracts().unwrap().collect()
}

pub fn utxos(&self) -> Vec<WalletUtxo> {
self.wallet.wallet().utxos().collect()
}

pub fn debug_contracts(&self) {
println!("Contracts:");
for info in self.list_contracts() {
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub use bpstd::{
};
pub use bpwallet::{
fs::FsTextStore, indexers::esplora::Client as EsploraClient, AnyIndexer, Indexer as BpIndexer,
Wallet,
Wallet, WalletUtxo,
};
pub use descriptors::Wpkh;
pub use electrum::{Client as ElectrumClient, ElectrumApi, Param};
Expand Down

0 comments on commit 5020765

Please sign in to comment.