Bitcoin ABC  0.24.10
P2P Digital Currency
core_io.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2016 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_CORE_IO_H
6 #define BITCOIN_CORE_IO_H
7 
8 #include <attributes.h>
9 #include <script/sighashtype.h>
10 
11 #include <string>
12 #include <vector>
13 
14 struct Amount;
15 class CBlock;
16 class CBlockHeader;
18 class CScript;
19 class CTransaction;
20 class uint256;
21 class UniValue;
22 
23 // core_read.cpp
24 CScript ParseScript(const std::string &s);
25 std::string ScriptToAsmStr(const CScript &script,
26  const bool fAttemptSighashDecode = false);
27 [[nodiscard]] bool DecodeHexTx(CMutableTransaction &tx,
28  const std::string &strHexTx);
29 [[nodiscard]] bool DecodeHexBlk(CBlock &, const std::string &strHexBlk);
30 bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header);
31 
40 bool ParseHashStr(const std::string &strHex, uint256 &result);
41 std::vector<uint8_t> ParseHexUV(const UniValue &v, const std::string &strName);
43 
44 // core_write.cpp
45 std::string FormatScript(const CScript &script);
46 std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags = 0);
47 std::string SighashToStr(uint8_t sighash_type);
48 void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out,
49  bool fIncludeHex);
50 void ScriptToUniv(const CScript &script, UniValue &out, bool include_address);
51 void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry,
52  bool include_hex = true, int serialize_flags = 0);
53 
54 #endif // BITCOIN_CORE_IO_H
ParseHashStr
bool ParseHashStr(const std::string &strHex, uint256 &result)
Parse a hex string into 256 bits.
Definition: core_read.cpp:247
ScriptToUniv
void ScriptToUniv(const CScript &script, UniValue &out, bool include_address)
Definition: core_write.cpp:171
SighashToStr
std::string SighashToStr(uint8_t sighash_type)
Definition: core_write.cpp:85
sighashtype.h
CBlockHeader
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:22
FormatScript
std::string FormatScript(const CScript &script)
Definition: core_write.cpp:20
UniValue
Definition: univalue.h:23
CTransaction
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:194
ScriptPubKeyToUniv
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
Definition: core_write.cpp:186
ParseScript
CScript ParseScript(const std::string &s)
Definition: core_read.cpp:59
DecodeHexTx
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx)
Definition: core_read.cpp:196
DecodeHexBlockHeader
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
Definition: core_read.cpp:216
SigHashType
Signature hash type wrapper class.
Definition: sighashtype.h:37
uint256
256-bit opaque blob.
Definition: uint256.h:127
Amount
Definition: amount.h:19
CScript
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:430
attributes.h
EncodeHexTx
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Definition: core_write.cpp:165
CBlock
Definition: block.h:55
TxToUniv
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0)
Definition: core_write.cpp:213
ParseSighashString
SigHashType ParseSighashString(const UniValue &sighash)
Definition: core_read.cpp:270
DecodeHexBlk
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
Definition: core_read.cpp:231
ScriptToAsmStr
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
Definition: core_write.cpp:102
ParseHexUV
std::vector< uint8_t > ParseHexUV(const UniValue &v, const std::string &strName)
Definition: core_read.cpp:256
CMutableTransaction
A mutable version of CTransaction.
Definition: transaction.h:278