mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 22:57:56 +02:00
kernel: Add chain params context option to C header
As a first option, add the chainparams. For now these can only be instantiated with default values. In future they may be expanded to take their own options for regtest and signet configurations. This commit also introduces a unique pattern for setting the option values when calling the `*_set(...)` function.
This commit is contained in:
@@ -390,8 +390,17 @@ BOOST_AUTO_TEST_CASE(btck_context_tests)
|
||||
CheckHandle(context, context2);
|
||||
}
|
||||
|
||||
{ // test with context options
|
||||
{ // test with context options, but not options set
|
||||
ContextOptions options{};
|
||||
Context context{options};
|
||||
}
|
||||
|
||||
{ // test with context options
|
||||
ContextOptions options{};
|
||||
ChainParams params{ChainType::MAINNET};
|
||||
ChainParams regtest_params{ChainType::REGTEST};
|
||||
CheckHandle(params, regtest_params);
|
||||
options.SetChainParams(params);
|
||||
Context context{options};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user