def test_purge_block(mock_client):
    watch_only_wallet = WatchOnlyWallet()
    controller = MainController(watch_only_wallet)
    controller.blockchain_client = mock_client
    watch_only_wallet.load(*WalletFile.load())
    controller._sync_to_blockchain()
    watch_only_wallet.refresh_balances()
    # Tx_ins from the orphaned block should not show up in our balance
    assert watch_only_wallet.spendable_balance_satoshis == 0
    assert watch_only_wallet.incoming_balance_satoshis == 888
    # Current block should be the most recent valid block
    assert watch_only_wallet.current_block == valid_block_4
    # Addresses that received a tx_in in an orphaned block should count as fresh
    assert list(watch_only_wallet.external_addresses.values())[0].is_fresh