TARAXA
Loading...
Searching...
No Matches
data.hpp
Go to the documentation of this file.
1#pragma once
2
4
6
12
16
18 std::shared_ptr<Transaction> trx;
19 std::optional<TransactionLocationWithBlockHash> trx_loc{};
20};
21
25
32
38
40 Address from;
41 u256 value;
43 std::optional<Address> to;
44 std::optional<trx_nonce_t> nonce;
45 std::optional<uint64_t> gas;
46 std::optional<u256> gas_price;
47};
48
52
53void add(Json::Value& obj, const std::optional<TransactionLocationWithBlockHash>& info);
54void add(Json::Value& obj, const ExtendedTransactionLocation& info);
55Json::Value toJson(const final_chain::BlockHeader& obj);
56Json::Value toJson(const Transaction& trx, const std::optional<TransactionLocationWithBlockHash>& loc);
57Json::Value toJson(const LocalisedTransaction& lt);
58Json::Value toJson(const final_chain::BlockHeader& obj);
59Json::Value toJson(const LocalisedLogEntry& lle);
60Json::Value toJson(const LocalisedTransactionReceipt& ltr);
61Json::Value toJson(const SyncStatus& obj);
62
63template <typename T>
64Json::Value toJson(const T& t) {
65 return toJS(t);
66}
67
68template <typename T>
69Json::Value toJsonArray(const std::vector<T>& _es) {
70 Json::Value res(Json::arrayValue);
71 for (const auto& e : _es) {
72 res.append(toJson(e));
73 }
74 return res;
75}
76
77template <typename T>
78Json::Value toJsonArray(std::shared_ptr<const std::vector<T>> _es) {
79 Json::Value res(Json::arrayValue);
80 for (const auto& e : *_es) {
81 res.append(toJson(e));
82 }
83 return res;
84}
85
86template <typename T>
87Json::Value toJson(const std::optional<T>& t) {
88 return t ? toJson(*t) : Json::Value();
89}
90
91// ERRORS
92const int CALL_EXCEPTION = 3;
93
94} // namespace taraxa::net::rpc::eth
Definition FixedHash.h:35
Definition data.hpp:40
Definition data.hpp:5
std::optional< uint64_t > gas
Definition data.hpp:45
Json::Value toJsonArray(const std::vector< T > &_es)
Definition data.hpp:69
std::optional< TransactionLocationWithBlockHash > trx_loc
Definition data.hpp:19
bytes data
Definition data.hpp:42
LogEntry le
Definition data.hpp:34
uint64_t position_in_receipt
Definition data.hpp:36
EthBlockNumber current_block
Definition data.hpp:50
Json::Value toJson(const final_chain::BlockHeader &obj)
Definition Eth.cpp:37
TransactionReceipt r
Definition data.hpp:27
Address from
Definition data.hpp:40
EthBlockNumber highest_block
Definition data.hpp:50
EthBlockNumber starting_block
Definition data.hpp:50
std::optional< addr_t > trx_to
Definition data.hpp:30
std::optional< trx_nonce_t > nonce
Definition data.hpp:44
ExtendedTransactionLocation trx_loc
Definition data.hpp:28
const int CALL_EXCEPTION
Definition data.hpp:92
std::optional< Address > to
Definition data.hpp:43
ExtendedTransactionLocation trx_loc
Definition data.hpp:35
std::shared_ptr< Transaction > trx
Definition data.hpp:18
void add(Json::Value &obj, const std::optional< TransactionLocationWithBlockHash > &info)
std::optional< u256 > gas_price
Definition data.hpp:46
Definition data.hpp:33
Definition data.hpp:49
std::vector< LogBloom > LogBlooms
Definition receipt.hpp:9
uint64_t EthBlockNumber
Definition types.hpp:24
std::vector< byte > bytes
Definition types.hpp:53
Definition receipt.hpp:11
Definition transaction.hpp:12
Definition receipt.hpp:37
Definition receipt.hpp:23