mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 14:47:31 +02:00
kernel: Add kernel library context object
The context introduced here holds the objects that will be required for running validation tasks, such as the chosen chain parameters, callbacks for validation events, and interrupt handling. These will be used by the chainstate manager introduced in subsequent commits. This commit also introduces conventions for defining option objects. A common pattern throughout the C header will be: ``` options = object_option_create(); object = object_create(options); ``` This allows for more consistent usage of a "builder pattern" for objects where options can be configured independently from instantiation.
This commit is contained in:
@@ -381,3 +381,17 @@ BOOST_AUTO_TEST_CASE(logging_tests)
|
||||
}
|
||||
Logger logger{std::make_unique<TestLog>()};
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(btck_context_tests)
|
||||
{
|
||||
{ // test default context
|
||||
Context context{};
|
||||
Context context2{};
|
||||
CheckHandle(context, context2);
|
||||
}
|
||||
|
||||
{ // test with context options
|
||||
ContextOptions options{};
|
||||
Context context{options};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user