Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | List of all members
FlushTest Struct Reference
Inheritance diagram for FlushTest:
[legend]
Collaboration diagram for FlushTest:
[legend]

Public Member Functions

Coin MakeCoin ()
 
void TestFlushBehavior (CCoinsViewCacheTest *view, CCoinsViewDB &base, std::vector< std::unique_ptr< CCoinsViewCacheTest > > &all_caches, bool do_erasing_flush)
 For CCoinsViewCache instances backed by either another cache instance or leveldb, test cache behavior and flag state (DIRTY/FRESH) by. More...
 
- Public Member Functions inherited from BasicTestingSetup
void SeedRandomForTest (SeedRand seed)
 Seed the global RNG state and m_rng for testing and log the seed value. More...
 
 BasicTestingSetup (const ChainType chainType=ChainType::MAIN, TestOpts={})
 
 ~BasicTestingSetup ()
 

Additional Inherited Members

- Public Attributes inherited from BasicTestingSetup
util::SignalInterrupt m_interrupt
 
node::NodeContext m_node
 
FastRandomContext m_rng
 
fs::path m_path_root
 
fs::path m_path_lock
 
bool m_has_custom_datadir {false}
 
ArgsManager m_args
 Test-specific arguments and settings. More...
 

Detailed Description

Definition at line 867 of file coins_tests.cpp.

Member Function Documentation

◆ MakeCoin()

Coin FlushTest::MakeCoin ( )
inline

Definition at line 868 of file coins_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestFlushBehavior()

void FlushTest::TestFlushBehavior ( CCoinsViewCacheTest *  view,
CCoinsViewDB base,
std::vector< std::unique_ptr< CCoinsViewCacheTest > > &  all_caches,
bool  do_erasing_flush 
)
inline

For CCoinsViewCache instances backed by either another cache instance or leveldb, test cache behavior and flag state (DIRTY/FRESH) by.

  1. Adding a random coin to the child-most cache,
  2. Flushing all caches (without erasing),
  3. Ensure the entry still exists in the cache and has been written to parent,
  4. (if do_erasing_flush) Flushing the caches again (with erasing),
  5. (if do_erasing_flush) Ensure the entry has been written to the parent and is no longer in the cache,
  6. Spend the coin, ensure it no longer exists in the parent.

Definition at line 888 of file coins_tests.cpp.

Here is the call graph for this function:

The documentation for this struct was generated from the following file: