You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

core_io.h 1.2KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2009-2015 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. #ifndef BITCOIN_CORE_IO_H
  5. #define BITCOIN_CORE_IO_H
  6. #include <string>
  7. #include <vector>
  8. class CBlock;
  9. class CScript;
  10. class CTransaction;
  11. class uint256;
  12. class UniValue;
  13. // core_read.cpp
  14. extern CScript ParseScript(const std::string& s);
  15. extern std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
  16. extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx);
  17. extern bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
  18. extern uint256 ParseHashUV(const UniValue& v, const std::string& strName);
  19. extern uint256 ParseHashStr(const std::string&, const std::string& strName);
  20. extern std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
  21. // core_write.cpp
  22. extern std::string FormatScript(const CScript& script);
  23. extern std::string EncodeHexTx(const CTransaction& tx);
  24. extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
  25. extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry);
  26. #endif // BITCOIN_CORE_IO_H