Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
chain_snapshot.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
sysio/chain/exceptions.hpp
>
4
5
namespace
sysio
{
namespace
chain {
6
7
struct
chain_snapshot_header
{
28
static
constexpr
uint32_t
minimum_compatible_version
= 2;
29
static
constexpr
uint32_t
current_version
= 6;
30
31
uint32_t
version
=
current_version
;
32
33
void
validate
()
const
{
34
auto
min
=
minimum_compatible_version
;
35
auto
max =
current_version
;
36
SYS_ASSERT
(
version
>=
min
&&
version
<= max,
37
snapshot_validation_exception,
38
"Unsupported version of chain snapshot: ${version}. Supported version must be between ${min} and ${max} inclusive."
,
39
(
"version"
,
version
)(
"min"
,
min
)(
"max"
,max));
40
}
41
};
42
43
} }
44
45
FC_REFLECT
(
sysio::chain::chain_snapshot_header
,(version))
exceptions.hpp
SYS_ASSERT
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition
exceptions.hpp:7
fc::min
const T & min(const T &a, const T &b)
Definition
utility.hpp:140
sysio
Definition
abi_serializer.cpp:8
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition
reflect.hpp:311
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
sysio::chain::chain_snapshot_header
Definition
chain_snapshot.hpp:7
sysio::chain::chain_snapshot_header::minimum_compatible_version
static constexpr uint32_t minimum_compatible_version
Definition
chain_snapshot.hpp:28
sysio::chain::chain_snapshot_header::version
uint32_t version
Definition
chain_snapshot.hpp:31
sysio::chain::chain_snapshot_header::validate
void validate() const
Definition
chain_snapshot.hpp:33
sysio::chain::chain_snapshot_header::current_version
static constexpr uint32_t current_version
Definition
chain_snapshot.hpp:29
libraries
chain
include
sysio
chain
chain_snapshot.hpp
Generated by
1.12.0