MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / AddTestCoin

Function AddTestCoin

src/test/util/coins.cpp:16–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include <utility>
15
16COutPoint AddTestCoin(FastRandomContext& rng, CCoinsViewCache& coins_view)
17{
18 Coin new_coin;
19 COutPoint outpoint{Txid::FromUint256(rng.rand256()), /*nIn=*/0};
20 new_coin.nHeight = 1;
21 new_coin.out.nValue = RandMoney(rng);
22 new_coin.out.scriptPubKey.assign(uint32_t{56}, 1);
23 coins_view.AddCoin(outpoint, std::move(new_coin), /*possible_overwrite=*/false);
24
25 return outpoint;
26};

Callers 3

BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_FIXTURE_TEST_CASEFunction · 0.85

Calls 4

RandMoneyFunction · 0.85
rand256Method · 0.80
AddCoinMethod · 0.80
assignMethod · 0.45

Tested by

no test coverage detected