tx_in.cpp raw

   1  // Copyright (c) 2019-present 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 <consensus/validation.h>
   6  #include <core_memusage.h>
   7  #include <policy/policy.h>
   8  #include <primitives/transaction.h>
   9  #include <streams.h>
  10  #include <test/fuzz/fuzz.h>
  11  
  12  #include <cassert>
  13  
  14  FUZZ_TARGET(tx_in)
  15  {
  16      CTxIn tx_in;
  17      try {
  18          SpanReader{buffer} >> tx_in;
  19      } catch (const std::ios_base::failure&) {
  20          return;
  21      }
  22  
  23      (void)GetTransactionInputWeight(tx_in);
  24      (void)GetVirtualTransactionInputSize(tx_in);
  25      (void)RecursiveDynamicUsage(tx_in);
  26  
  27      (void)tx_in.ToString();
  28  }
  29