|
2 | 2 | // Distributed under the MIT software license, see the accompanying
|
3 | 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
4 | 4 |
|
| 5 | +#include <chainparams.h> |
5 | 6 | #include <coins.h>
|
6 | 7 | #include <consensus/tx_check.h>
|
7 | 8 | #include <consensus/tx_verify.h>
|
|
13 | 14 | #include <primitives/transaction.h>
|
14 | 15 | #include <streams.h>
|
15 | 16 | #include <test/fuzz/fuzz.h>
|
| 17 | +#include <univalue.h> |
16 | 18 | #include <util/rbf.h>
|
17 | 19 | #include <validation.h>
|
18 | 20 | #include <version.h>
|
19 | 21 |
|
20 | 22 | #include <cassert>
|
21 | 23 |
|
| 24 | +void initialize() |
| 25 | +{ |
| 26 | + SelectParams(CBaseChainParams::REGTEST); |
| 27 | +} |
| 28 | + |
22 | 29 | void test_one_input(const std::vector<uint8_t>& buffer)
|
23 | 30 | {
|
24 | 31 | CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);
|
@@ -85,4 +92,21 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
85 | 92 | (void)IsStandardTx(tx, reason);
|
86 | 93 | (void)RecursiveDynamicUsage(tx);
|
87 | 94 | (void)SignalsOptInRBF(tx);
|
| 95 | + |
| 96 | + CCoinsView coins_view; |
| 97 | + const CCoinsViewCache coins_view_cache(&coins_view); |
| 98 | + (void)AreInputsStandard(tx, coins_view_cache); |
| 99 | + (void)IsWitnessStandard(tx, coins_view_cache); |
| 100 | + |
| 101 | + UniValue u(UniValue::VOBJ); |
| 102 | + // ValueFromAmount(i) not defined when i == std::numeric_limits<int64_t>::min() |
| 103 | + bool skip_tx_to_univ = false; |
| 104 | + for (const CTxOut& txout : tx.vout) { |
| 105 | + if (txout.nValue == std::numeric_limits<int64_t>::min()) { |
| 106 | + skip_tx_to_univ = true; |
| 107 | + } |
| 108 | + } |
| 109 | + if (!skip_tx_to_univ) { |
| 110 | + TxToUniv(tx, /* hashBlock */ {}, u); |
| 111 | + } |
88 | 112 | }
|
0 commit comments