ipc_test.h raw

   1  // Copyright (c) 2023-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  #ifndef BITCOIN_IPC_TEST_IPC_TEST_H
   6  #define BITCOIN_IPC_TEST_IPC_TEST_H
   7  
   8  #include <primitives/transaction.h>
   9  #include <script/script.h>
  10  #include <univalue.h>
  11  #include <util/fs.h>
  12  #include <validation.h>
  13  
  14  class FooImplementation
  15  {
  16  public:
  17      int add(int a, int b) { return a + b; }
  18      COutPoint passOutPoint(COutPoint o) { return o; }
  19      UniValue passUniValue(UniValue v) { return v; }
  20      CTransactionRef passTransaction(CTransactionRef t) { return t; }
  21      std::vector<CTransactionRef> passTransactions(std::vector<CTransactionRef> t) { return t; }
  22      std::vector<char> passVectorChar(std::vector<char> v) { return v; }
  23      BlockValidationState passBlockState(BlockValidationState s) { return s; }
  24      CScript passScript(CScript s) { return s; }
  25  };
  26  
  27  void IpcPipeTest();
  28  void IpcSocketPairTest();
  29  void IpcSocketTest(const fs::path& datadir);
  30  
  31  #endif // BITCOIN_IPC_TEST_IPC_TEST_H
  32