Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
block_header.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
sysio/chain/block_timestamp.hpp
>
3
#include <
sysio/chain/producer_schedule.hpp
>
4
#include <
sysio/chain/protocol_feature_activation.hpp
>
5
#include <
sysio/chain/s_root_extension.hpp
>
6
#include <type_traits>
7
8
namespace
sysio
{
namespace
chain {
9
10
namespace
detail
{
11
template
<
typename
... Ts>
12
struct
block_header_extension_types
{
13
using
block_header_extension_t
= std::variant< Ts... >;
14
using
decompose_t
=
decompose
< Ts... >;
15
};
16
}
17
18
using
block_header_extension_types
=
detail::block_header_extension_types
<
19
protocol_feature_activation
,
// 0
20
producer_schedule_change_extension
,
// 1
21
s_root_extension
// 2 out new acceptable type
22
>;
23
24
using
block_header_extension
=
block_header_extension_types::block_header_extension_t
;
25
26
struct
block_header
27
{
28
block_timestamp_type
timestamp
;
29
account_name
producer
;
30
40
uint16_t
confirmed
= 1;
41
42
block_id_type
previous
;
43
44
checksum256_type
transaction_mroot
;
45
checksum256_type
action_mroot
;
46
57
using
new_producers_type
= std::optional<legacy::producer_schedule_type>;
58
59
uint32_t
schedule_version
= 0;
60
new_producers_type
new_producers
;
61
extensions_type
header_extensions
;
62
63
64
block_header
() =
default
;
65
66
digest_type
digest
()
const
;
67
block_id_type
calculate_id
()
const
;
68
uint32_t
block_num
()
const
{
return
num_from_id
(
previous
) + 1; }
69
static
uint32_t
num_from_id
(
const
block_id_type
&
id
);
70
71
flat_multimap<uint16_t, block_header_extension>
validate_and_extract_header_extensions
()
const
;
72
};
73
74
75
struct
signed_block_header
:
public
block_header
76
{
77
signature_type
producer_signature
;
78
};
79
80
} }
81
82
FC_REFLECT
(
sysio::chain::block_header
,
83
(timestamp)(producer)(confirmed)(previous)
84
(transaction_mroot)(action_mroot)
85
(schedule_version)(new_producers)(header_extensions))
86
87
FC_REFLECT_DERIVED
(
sysio::chain::signed_block_header
, (
sysio::chain::block_header
), (producer_signature))
block_timestamp.hpp
fc::crypto::signature
Definition
signature.hpp:22
fc::sha256
Definition
sha256.hpp:12
fc::vector< std::pair< uint16_t, vector< char > > >
sysio::chain::block_timestamp< config::block_interval_ms, config::block_timestamp_epoch >
detail
Definition
main.cpp:23
sysio::chain::block_header_extension
block_header_extension_types::block_header_extension_t block_header_extension
Definition
block_header.hpp:24
sysio
Definition
abi_serializer.cpp:8
producer_schedule.hpp
protocol_feature_activation.hpp
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition
reflect.hpp:311
FC_REFLECT_DERIVED
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
Definition
reflect.hpp:298
s_root_extension.hpp
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
sysio::chain::block_header
Definition
block_header.hpp:27
sysio::chain::block_header::new_producers_type
std::optional< legacy::producer_schedule_type > new_producers_type
mroot of all delivered action receipts
Definition
block_header.hpp:57
sysio::chain::block_header::timestamp
block_timestamp_type timestamp
Definition
block_header.hpp:28
sysio::chain::block_header::confirmed
uint16_t confirmed
Definition
block_header.hpp:40
sysio::chain::block_header::transaction_mroot
checksum256_type transaction_mroot
Definition
block_header.hpp:44
sysio::chain::block_header::block_header
block_header()=default
sysio::chain::block_header::num_from_id
static uint32_t num_from_id(const block_id_type &id)
Definition
block_header.cpp:13
sysio::chain::block_header::action_mroot
checksum256_type action_mroot
mroot of cycles_summary
Definition
block_header.hpp:45
sysio::chain::block_header::previous
block_id_type previous
Definition
block_header.hpp:42
sysio::chain::block_header::digest
digest_type digest() const
Definition
block_header.cpp:8
sysio::chain::block_header::block_num
uint32_t block_num() const
Definition
block_header.hpp:68
sysio::chain::block_header::schedule_version
uint32_t schedule_version
Definition
block_header.hpp:59
sysio::chain::block_header::header_extensions
extensions_type header_extensions
Definition
block_header.hpp:61
sysio::chain::block_header::calculate_id
block_id_type calculate_id() const
Definition
block_header.cpp:18
sysio::chain::block_header::producer
account_name producer
Definition
block_header.hpp:29
sysio::chain::block_header::validate_and_extract_header_extensions
flat_multimap< uint16_t, block_header_extension > validate_and_extract_header_extensions() const
Definition
block_header.cpp:27
sysio::chain::block_header::new_producers
new_producers_type new_producers
Definition
block_header.hpp:60
sysio::chain::detail::block_header_extension_types
Definition
block_header.hpp:12
sysio::chain::detail::block_header_extension_types::block_header_extension_t
std::variant< Ts... > block_header_extension_t
Definition
block_header.hpp:13
sysio::chain::detail::decompose
Definition
types.hpp:327
sysio::chain::name
Immutable except for fc::from_variant.
Definition
name.hpp:43
sysio::chain::producer_schedule_change_extension
Definition
producer_schedule.hpp:293
sysio::chain::protocol_feature_activation
Definition
protocol_feature_activation.hpp:7
sysio::chain::s_root_extension
Definition
s_root_extension.hpp:44
sysio::chain::signed_block_header
Definition
block_header.hpp:76
sysio::chain::signed_block_header::producer_signature
signature_type producer_signature
Definition
block_header.hpp:77
libraries
chain
include
sysio
chain
block_header.hpp
Generated by
1.12.0