32 #ifndef LEDGER_CORE_TEZOSLIKEBLOCKPARSER_H 33 #define LEDGER_CORE_TEZOSLIKEBLOCKPARSER_H 35 #include <wallet/common/explorers/api/AbstractBlockParser.h> 36 #include "../TezosLikeBlockchainExplorer.h" 44 bool RawNumber(
const rapidjson::Reader::Ch *str, rapidjson::SizeType length,
bool copy) {
45 if (getLastKey() ==
"level" || getLastKey() ==
"height") {
46 std::string number(str, length);
47 BigInt value = BigInt::fromString(number);
48 _block->height = value.toUint64();
53 bool String(
const rapidjson::Reader::Ch *str, rapidjson::SizeType length,
bool copy) {
54 std::string value = std::string(str, length);
55 if (getLastKey() ==
"hash" && _block->hash.empty()) {
57 }
else if (getLastKey() ==
"timestamp" || getLastKey() ==
"time") {
58 _block->time = DateUtils::fromJSON(value);
64 std::string &getLastKey()
override {
68 std::string &_lastKey;
72 #endif //LEDGER_CORE_TEZOSLIKEBLOCKPARSER_H Definition: TezosLikeBlockParser.h:40
Definition: AbstractBlockParser.h:45
Definition: Account.cpp:8