Raven Core  3.0.0
P2P Digital Currency
core_io.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_CORE_IO_H
7 #define RAVEN_CORE_IO_H
8 
9 #include "amount.h"
10 
11 #include <string>
12 #include <vector>
13 
14 class CBlock;
15 class CScript;
16 class CTransaction;
17 struct CMutableTransaction;
18 class uint256;
19 class UniValue;
20 
21 // core_read.cpp
22 CScript ParseScript(const std::string& s);
23 std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
24 bool DecodeHexTx(CMutableTransaction& tx, const std::string& strHexTx, bool fTryNoWitness = false);
25 bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
26 uint256 ParseHashUV(const UniValue& v, const std::string& strName);
27 uint256 ParseHashStr(const std::string&, const std::string& strName);
28 std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
29 
30 // core_write.cpp
31 std::string ValueFromAmountString(const CAmount& amount, const int8_t units);
32 UniValue ValueFromAmount(const CAmount& amount, const int8_t units);
33 UniValue ValueFromAmount(const CAmount& amount);
34 std::string FormatScript(const CScript& script);
35 std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
36 void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
37 void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0);
38 
39 #endif // RAVEN_CORE_IO_H
std::vector< unsigned char > ParseHexUV(const UniValue &v, const std::string &strName)
Definition: core_read.cpp:182
std::string FormatScript(const CScript &script)
Definition: core_write.cpp:48
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
Definition: core_read.cpp:147
Definition: block.h:73
UniValue ValueFromAmount(const CAmount &amount, const int8_t units)
Definition: core_write.cpp:38
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
Definition: core_write.cpp:99
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx, bool fTryNoWitness=false)
Definition: core_read.cpp:112
uint256 ParseHashUV(const UniValue &v, const std::string &strName)
Definition: core_read.cpp:164
std::string ValueFromAmountString(const CAmount &amount, const int8_t units)
Definition: core_write.cpp:22
256-bit opaque blob.
Definition: uint256.h:123
uint256 ParseHashStr(const std::string &, const std::string &strName)
Definition: core_read.cpp:172
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:396
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Definition: core_write.cpp:143
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
Definition: core_write.cpp:150
A mutable version of CTransaction.
Definition: transaction.h:389
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0)
Definition: core_write.cpp:252
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:270
CScript ParseScript(const std::string &s)
Definition: core_read.cpp:23