Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
blockinfo_tester.hpp
Go to the documentation of this file.
1#pragma once
2
3#ifdef TEST_INCLUDE
4
5#include <fc/io/varint.hpp>
6#include <fc/time.hpp>
7
8#else
9
10#include <sysio/time.hpp>
11#include <sysio/varint.hpp>
12
14
15#endif
16
17#include <cstdint>
18#include <optional>
19#include <variant>
20
22
23#ifdef TEST_INCLUDE
24
27
28#else
29
32
33#endif
34
46
47#ifdef TEST_INCLUDE
48
50{
55};
56
57#else
58
60
61#endif
62
67{
75
76 std::optional<block_batch_info> result;
77 varint error_code = no_error;
78
79 bool has_error() const { return !(error_code.value == no_error && result.has_value()); }
80
81 error_code_enum get_error() const { return static_cast<error_code_enum>(error_code.value); }
82
83#ifndef TEST_INCLUDE
84
85 SYSLIB_SERIALIZE(latest_block_batch_info_result, (result)(error_code))
86
87#endif
88};
89
90using input_type = std::variant<get_latest_block_batch_info>;
91
92using output_type = std::variant<latest_block_batch_info_result>;
93
94} // namespace system_contracts::testing::test_contracts::blockinfo_tester
95
96#ifdef TEST_INCLUDE
97
99 (batch_start_height_offset)(batch_size))
101 (batch_start_height)(batch_start_timestamp)(batch_current_end_height)(batch_current_end_timestamp))
104 (no_error)(invalid_input)(unsupported_version)(insufficient_data))
106 (result)(error_code))
107
108#endif
std::variant< get_latest_block_batch_info > input_type
std::variant< latest_block_batch_info_result > output_type
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
#define FC_REFLECT_ENUM(ENUM, FIELDS)
Definition reflect.hpp:194
unsigned int uint32_t
Definition stdint.h:126