mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
* Saving raw inputs in the ledger. * Store full history in separate folder. * Moved full history fb structs to a seperate fbs file * Removed raw_inputs from the proposal * Fixed code comments * Saving raw user input string * Code refactoring * Resolved PR comments
212 lines
7.9 KiB
C++
212 lines
7.9 KiB
C++
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
|
|
#ifndef FLATBUFFERS_GENERATED_LEDGERSCHEMA_MSG_FBUF_LEDGER_H_
|
|
#define FLATBUFFERS_GENERATED_LEDGERSCHEMA_MSG_FBUF_LEDGER_H_
|
|
|
|
#include "flatbuffers/flatbuffers.h"
|
|
|
|
#include "common_schema_generated.h"
|
|
|
|
namespace msg {
|
|
namespace fbuf {
|
|
namespace ledger {
|
|
|
|
struct LedgerBlock;
|
|
struct LedgerBlockBuilder;
|
|
|
|
struct LedgerBlock FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|
typedef LedgerBlockBuilder Builder;
|
|
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
|
VT_SEQ_NO = 4,
|
|
VT_TIME = 6,
|
|
VT_LCL = 8,
|
|
VT_STATE = 10,
|
|
VT_USERS = 12,
|
|
VT_INPUTS = 14,
|
|
VT_OUTPUTS = 16
|
|
};
|
|
uint64_t seq_no() const {
|
|
return GetField<uint64_t>(VT_SEQ_NO, 0);
|
|
}
|
|
bool mutate_seq_no(uint64_t _seq_no) {
|
|
return SetField<uint64_t>(VT_SEQ_NO, _seq_no, 0);
|
|
}
|
|
uint64_t time() const {
|
|
return GetField<uint64_t>(VT_TIME, 0);
|
|
}
|
|
bool mutate_time(uint64_t _time) {
|
|
return SetField<uint64_t>(VT_TIME, _time, 0);
|
|
}
|
|
const flatbuffers::Vector<uint8_t> *lcl() const {
|
|
return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_LCL);
|
|
}
|
|
flatbuffers::Vector<uint8_t> *mutable_lcl() {
|
|
return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_LCL);
|
|
}
|
|
const flatbuffers::Vector<uint8_t> *state() const {
|
|
return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_STATE);
|
|
}
|
|
flatbuffers::Vector<uint8_t> *mutable_state() {
|
|
return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_STATE);
|
|
}
|
|
const flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *users() const {
|
|
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *>(VT_USERS);
|
|
}
|
|
flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *mutable_users() {
|
|
return GetPointer<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *>(VT_USERS);
|
|
}
|
|
const flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *inputs() const {
|
|
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *>(VT_INPUTS);
|
|
}
|
|
flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *mutable_inputs() {
|
|
return GetPointer<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *>(VT_INPUTS);
|
|
}
|
|
const flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *outputs() const {
|
|
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *>(VT_OUTPUTS);
|
|
}
|
|
flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *mutable_outputs() {
|
|
return GetPointer<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *>(VT_OUTPUTS);
|
|
}
|
|
bool Verify(flatbuffers::Verifier &verifier) const {
|
|
return VerifyTableStart(verifier) &&
|
|
VerifyField<uint64_t>(verifier, VT_SEQ_NO) &&
|
|
VerifyField<uint64_t>(verifier, VT_TIME) &&
|
|
VerifyOffset(verifier, VT_LCL) &&
|
|
verifier.VerifyVector(lcl()) &&
|
|
VerifyOffset(verifier, VT_STATE) &&
|
|
verifier.VerifyVector(state()) &&
|
|
VerifyOffset(verifier, VT_USERS) &&
|
|
verifier.VerifyVector(users()) &&
|
|
verifier.VerifyVectorOfTables(users()) &&
|
|
VerifyOffset(verifier, VT_INPUTS) &&
|
|
verifier.VerifyVector(inputs()) &&
|
|
verifier.VerifyVectorOfTables(inputs()) &&
|
|
VerifyOffset(verifier, VT_OUTPUTS) &&
|
|
verifier.VerifyVector(outputs()) &&
|
|
verifier.VerifyVectorOfTables(outputs()) &&
|
|
verifier.EndTable();
|
|
}
|
|
};
|
|
|
|
struct LedgerBlockBuilder {
|
|
typedef LedgerBlock Table;
|
|
flatbuffers::FlatBufferBuilder &fbb_;
|
|
flatbuffers::uoffset_t start_;
|
|
void add_seq_no(uint64_t seq_no) {
|
|
fbb_.AddElement<uint64_t>(LedgerBlock::VT_SEQ_NO, seq_no, 0);
|
|
}
|
|
void add_time(uint64_t time) {
|
|
fbb_.AddElement<uint64_t>(LedgerBlock::VT_TIME, time, 0);
|
|
}
|
|
void add_lcl(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> lcl) {
|
|
fbb_.AddOffset(LedgerBlock::VT_LCL, lcl);
|
|
}
|
|
void add_state(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> state) {
|
|
fbb_.AddOffset(LedgerBlock::VT_STATE, state);
|
|
}
|
|
void add_users(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>>> users) {
|
|
fbb_.AddOffset(LedgerBlock::VT_USERS, users);
|
|
}
|
|
void add_inputs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>>> inputs) {
|
|
fbb_.AddOffset(LedgerBlock::VT_INPUTS, inputs);
|
|
}
|
|
void add_outputs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>>> outputs) {
|
|
fbb_.AddOffset(LedgerBlock::VT_OUTPUTS, outputs);
|
|
}
|
|
explicit LedgerBlockBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
|
: fbb_(_fbb) {
|
|
start_ = fbb_.StartTable();
|
|
}
|
|
flatbuffers::Offset<LedgerBlock> Finish() {
|
|
const auto end = fbb_.EndTable(start_);
|
|
auto o = flatbuffers::Offset<LedgerBlock>(end);
|
|
return o;
|
|
}
|
|
};
|
|
|
|
inline flatbuffers::Offset<LedgerBlock> CreateLedgerBlock(
|
|
flatbuffers::FlatBufferBuilder &_fbb,
|
|
uint64_t seq_no = 0,
|
|
uint64_t time = 0,
|
|
flatbuffers::Offset<flatbuffers::Vector<uint8_t>> lcl = 0,
|
|
flatbuffers::Offset<flatbuffers::Vector<uint8_t>> state = 0,
|
|
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>>> users = 0,
|
|
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>>> inputs = 0,
|
|
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<msg::fbuf::ByteArray>>> outputs = 0) {
|
|
LedgerBlockBuilder builder_(_fbb);
|
|
builder_.add_time(time);
|
|
builder_.add_seq_no(seq_no);
|
|
builder_.add_outputs(outputs);
|
|
builder_.add_inputs(inputs);
|
|
builder_.add_users(users);
|
|
builder_.add_state(state);
|
|
builder_.add_lcl(lcl);
|
|
return builder_.Finish();
|
|
}
|
|
|
|
inline flatbuffers::Offset<LedgerBlock> CreateLedgerBlockDirect(
|
|
flatbuffers::FlatBufferBuilder &_fbb,
|
|
uint64_t seq_no = 0,
|
|
uint64_t time = 0,
|
|
const std::vector<uint8_t> *lcl = nullptr,
|
|
const std::vector<uint8_t> *state = nullptr,
|
|
const std::vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *users = nullptr,
|
|
const std::vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *inputs = nullptr,
|
|
const std::vector<flatbuffers::Offset<msg::fbuf::ByteArray>> *outputs = nullptr) {
|
|
auto lcl__ = lcl ? _fbb.CreateVector<uint8_t>(*lcl) : 0;
|
|
auto state__ = state ? _fbb.CreateVector<uint8_t>(*state) : 0;
|
|
auto users__ = users ? _fbb.CreateVector<flatbuffers::Offset<msg::fbuf::ByteArray>>(*users) : 0;
|
|
auto inputs__ = inputs ? _fbb.CreateVector<flatbuffers::Offset<msg::fbuf::ByteArray>>(*inputs) : 0;
|
|
auto outputs__ = outputs ? _fbb.CreateVector<flatbuffers::Offset<msg::fbuf::ByteArray>>(*outputs) : 0;
|
|
return msg::fbuf::ledger::CreateLedgerBlock(
|
|
_fbb,
|
|
seq_no,
|
|
time,
|
|
lcl__,
|
|
state__,
|
|
users__,
|
|
inputs__,
|
|
outputs__);
|
|
}
|
|
|
|
inline const msg::fbuf::ledger::LedgerBlock *GetLedgerBlock(const void *buf) {
|
|
return flatbuffers::GetRoot<msg::fbuf::ledger::LedgerBlock>(buf);
|
|
}
|
|
|
|
inline const msg::fbuf::ledger::LedgerBlock *GetSizePrefixedLedgerBlock(const void *buf) {
|
|
return flatbuffers::GetSizePrefixedRoot<msg::fbuf::ledger::LedgerBlock>(buf);
|
|
}
|
|
|
|
inline LedgerBlock *GetMutableLedgerBlock(void *buf) {
|
|
return flatbuffers::GetMutableRoot<LedgerBlock>(buf);
|
|
}
|
|
|
|
inline bool VerifyLedgerBlockBuffer(
|
|
flatbuffers::Verifier &verifier) {
|
|
return verifier.VerifyBuffer<msg::fbuf::ledger::LedgerBlock>(nullptr);
|
|
}
|
|
|
|
inline bool VerifySizePrefixedLedgerBlockBuffer(
|
|
flatbuffers::Verifier &verifier) {
|
|
return verifier.VerifySizePrefixedBuffer<msg::fbuf::ledger::LedgerBlock>(nullptr);
|
|
}
|
|
|
|
inline void FinishLedgerBlockBuffer(
|
|
flatbuffers::FlatBufferBuilder &fbb,
|
|
flatbuffers::Offset<msg::fbuf::ledger::LedgerBlock> root) {
|
|
fbb.Finish(root);
|
|
}
|
|
|
|
inline void FinishSizePrefixedLedgerBlockBuffer(
|
|
flatbuffers::FlatBufferBuilder &fbb,
|
|
flatbuffers::Offset<msg::fbuf::ledger::LedgerBlock> root) {
|
|
fbb.FinishSizePrefixed(root);
|
|
}
|
|
|
|
} // namespace ledger
|
|
} // namespace fbuf
|
|
} // namespace msg
|
|
|
|
#endif // FLATBUFFERS_GENERATED_LEDGERSCHEMA_MSG_FBUF_LEDGER_H_
|