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:
TheCharlatan
2024-06-03 14:44:55 +02:00
parent 337ea860df
commit 9e1bac4585
4 changed files with 145 additions and 3 deletions

View File

@@ -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};
}
}