MCPcopy Create free account
hub / github.com/ElementsProject/elements / initialize_simplicity

Function initialize_simplicity

src/test/fuzz/simplicity.cpp:39–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void initialize_simplicity()
40{
41 g_con_elementsmode = true;
42
43 GENESIS_HASH = uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206");
44
45 INPUT_VALUE_UNCONF.SetToAmount(12345678);
46 INPUT_VALUE_CONF.vchCommitment = {
47 0x08,
48 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
49 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
50 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
51 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
52 };
53
54 INPUT_ASSET_UNCONF.vchCommitment = INPUT_VALUE_CONF.vchCommitment;
55 INPUT_ASSET_UNCONF.vchCommitment[0] = 0x01;
56 INPUT_ASSET_CONF.vchCommitment = INPUT_VALUE_CONF.vchCommitment;
57 INPUT_ASSET_CONF.vchCommitment[0] = 0x0a;
58
59 XOnlyPubKey intkey = XOnlyPubKey{uint256::ONE};
60 XOnlyPubKey extkey = XOnlyPubKey{uint256::ONE};
61 TAPROOT_SCRIPT_PUB_KEY = CScript{} << OP_1 << std::vector<unsigned char>(extkey.begin(), extkey.end());
62 // TODO have control block of nontrivial path length
63 TAPROOT_CONTROL.push_back(TAPROOT_LEAF_TAPSIMPLICITY | 1); // 1 is parity
64 TAPROOT_CONTROL.insert(TAPROOT_CONTROL.end(), intkey.begin(), intkey.end());
65}
66
67uint32_t read_u32(const unsigned char **buf) {
68 uint32_t ret;

Callers

nothing calls this directly

Calls 6

uint256SFunction · 0.85
SetToAmountMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected