-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathcoin_smoke.cpp
More file actions
55 lines (47 loc) · 1.77 KB
/
Copy pathcoin_smoke.cpp
File metadata and controls
55 lines (47 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// NMC coin P0 structural-leaf smoke translation unit.
//
// Header-only NMC coin types (block.hpp, header_chain.hpp) are otherwise never
// instantiated in a .cpp, so they would not be compile-checked by the build.
// This TU forces instantiation of the P0 structural leaf so CMake's nmc_coin
// target actually compiles header_chain.hpp (and its AuxPow / HeaderChain
// skeleton). It does NOT perform any validation — consistent with the P0 fence.
#include "header_chain.hpp"
#include "block.hpp"
#include "mempool.hpp"
#include "rpc_data.hpp"
#include "template_builder.hpp"
namespace nmc {
namespace coin {
// Force template/inline instantiation of the structural leaf.
void nmc_coin_p0_smoke()
{
NMCChainParams params = NMCChainParams::mainnet();
HeaderChain chain(params);
(void)chain.init();
(void)chain.height();
(void)chain.size();
BlockHeaderType header;
header.SetNull();
(void)block_hash(header);
(void)pow_hash(header);
AuxPow auxpow;
auxpow.SetNull();
// P0-DEFER stub must report NOT_IMPLEMENTED_P0.
(void)auxpow.check_proof(uint256{}, params.aux_chain_id);
AuxChain aux_slot;
std::vector<AuxChain> aux_chains; // nmc-local list (fence #4)
aux_chains.push_back(aux_slot);
(void)aux_chains;
// P1 PC: force-compile the embedded template builder + work-data types.
Mempool pool;
(void)pool.size();
(void)get_block_subsidy(0u);
(void)compute_merkle_root(std::vector<uint256>{});
auto wd = TemplateBuilder::build_template(chain, pool, /*is_testnet=*/false);
(void)wd; // nullopt on an empty chain -- structural compile-check only
EmbeddedCoinNode node(chain, pool, /*testnet=*/false);
(void)node.getblockchaininfo();
(void)node.is_synced();
}
} // namespace coin
} // namespace nmc