Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockchain: Add UtxoCache Initialize tests. #2599

Merged
merged 4 commits into from
Mar 1, 2021

Commits on Feb 27, 2021

  1. blockchain: Make InitUtxoCache a UtxoCache method.

    This changes the InitUtxoCache method on the BlockChain type to a
    Initialize method on the UtxoCache type instead.  This simplifies
    providing alternative implementations for testing since the Initialize
    method deals with internal fields of the UtxoCache type.
    rstaudt2 committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    652a338 View commit details
    Browse the repository at this point in the history
  2. blockchain: Add UtxoCacher interface.

    This adds a UtxoCacher interface so that alternative utxo cache
    implementations can be provided.  In particular, this will be used to
    provide a mock implementation for testing in order to more easily
    simulate various scenarios.
    
    In addition to introducing the UtxoCacher interface, this updates
    BlockChain and UtxoViewpoint to use the interface rather than the
    concrete type.
    rstaudt2 committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    f937c63 View commit details
    Browse the repository at this point in the history
  3. blockchain: Add UtxoCache Initialize tests.

    This adds tests for the UtxoCache Initialize method.  These tests
    include recovery scenarios that are particularly hard to simulate to
    ensure that those code paths are not broken in the future.
    
    In order to test recovery scenarios, this introduces a test utxo cache
    that allows for toggling flushing on and off.
    
    Additionally, this adds an ExpectUtxoSetState method to chaingenHarness
    that allows for easily validating the last flushed block for the utxo
    set.
    rstaudt2 committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    beccde2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    29e5b9b View commit details
    Browse the repository at this point in the history