test: wait for verified history rows before asserting on them

The funded-wallet ViewModel tests only waited for the history row to
appear, but the Merkle proof can complete after sync reports idle. On the
slower Windows runner the assertions on Verified and the spend tests (which
need verified UTXOs) raced it and failed. Wait for the row to be verified.
This commit is contained in:
davide committed 2026-11-03 21:19:36 +01:00
1 parent 9010ebce59
commit ed8de06609
5 files changed
+65 -10

No files matched your search

@@ -937,6 +937,25 @@ public class WalletSynchronizerTests
Assert.True(Assert.Single(again.History).Verified);
}
[Fact]
public async Task A_witness_provider_that_throws_leaves_only_the_merkle_proof()
{
var account = Account(ProfileWithCheckpointAt100());
var scenario = new Scenario();
scenario.Pay(account.GetReceiveAddress(0), 1_000_000, height: 150);
var (server, client) = await StartAsync(scenario);
await using var _ = server; await using var __ = client;
var sync = new WalletSynchronizer(account, client)
{
WitnessProvider = _ => throw new IOException("cannot open witnesses"),
};
var result = await sync.SyncOnceAsync();
Assert.Equal(1_000_000, result.SpendableSats);
Assert.Equal(0, result.PendingVerificationSats);
}
[Fact]
public async Task A_witness_that_does_not_know_the_block_or_is_gone_is_skipped()
{