LCOV - code coverage report
Current view: top level - src/test/util - coins.cpp (source / functions) Hit Total Coverage
Test: test_dash_coverage.info Lines: 9 9 100.0 %
Date: 2026-06-25 07:23:51 Functions: 1 1 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2023 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <test/util/coins.h>
       6             : 
       7             : #include <coins.h>
       8             : #include <primitives/transaction.h>
       9             : #include <script/script.h>
      10             : #include <test/util/random.h>
      11             : #include <uint256.h>
      12             : 
      13             : #include <stdint.h>
      14             : #include <utility>
      15             : 
      16        1001 : COutPoint AddTestCoin(CCoinsViewCache& coins_view)
      17             : {
      18        1001 :     Coin new_coin;
      19        1001 :     const uint256 txid{InsecureRand256()};
      20        1001 :     COutPoint outpoint{txid, /*nIn=*/0};
      21        1001 :     new_coin.nHeight = 1;
      22        1001 :     new_coin.out.nValue = InsecureRandMoneyAmount();
      23        1001 :     new_coin.out.scriptPubKey.assign(uint32_t{56}, 1);
      24        1001 :     coins_view.AddCoin(outpoint, std::move(new_coin), /*possible_overwrite=*/false);
      25             : 
      26             :     return outpoint;
      27        1001 : };

Generated by: LCOV version 1.16