Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::signed_block Struct Reference

#include <block.hpp>

Inheritance diagram for sysio::chain::signed_block:
Collaboration diagram for sysio::chain::signed_block:

Public Member Functions

 signed_block ()=default
 
 signed_block (const signed_block_header &h)
 
 signed_block (signed_block &&)=default
 
signed_blockoperator= (const signed_block &)=delete
 
signed_blockoperator= (signed_block &&)=default
 
signed_block clone () const
 
flat_multimap< uint16_t, block_extensionvalidate_and_extract_extensions () const
 
- Public Member Functions inherited from sysio::chain::block_header
 block_header ()=default
 
digest_type digest () const
 
block_id_type calculate_id () const
 
uint32_t block_num () const
 
flat_multimap< uint16_t, block_header_extensionvalidate_and_extract_header_extensions () const
 

Public Attributes

vector< transaction_receipttransactions
 
extensions_type block_extensions
 new or generated transactions
 
- Public Attributes inherited from sysio::chain::signed_block_header
signature_type producer_signature
 
- Public Attributes inherited from sysio::chain::block_header
block_timestamp_type timestamp
 
account_name producer
 
uint16_t confirmed = 1
 
block_id_type previous
 
checksum256_type transaction_mroot
 
checksum256_type action_mroot
 mroot of cycles_summary
 
uint32_t schedule_version = 0
 
new_producers_type new_producers
 
extensions_type header_extensions
 

Additional Inherited Members

- Public Types inherited from sysio::chain::block_header
using new_producers_type = std::optional<legacy::producer_schedule_type>
 mroot of all delivered action receipts
 
- Static Public Member Functions inherited from sysio::chain::block_header
static uint32_t num_from_id (const block_id_type &id)
 

Detailed Description

Definition at line 89 of file block.hpp.

Constructor & Destructor Documentation

◆ signed_block() [1/3]

sysio::chain::signed_block::signed_block ( )
default

◆ signed_block() [2/3]

sysio::chain::signed_block::signed_block ( const signed_block_header & h)
inlineexplicit

Definition at line 94 of file block.hpp.

94:signed_block_header(h){}

◆ signed_block() [3/3]

sysio::chain::signed_block::signed_block ( signed_block && )
default

Member Function Documentation

◆ clone()

signed_block sysio::chain::signed_block::clone ( ) const
inline

Definition at line 98 of file block.hpp.

98{ return *this; }

◆ operator=() [1/2]

signed_block & sysio::chain::signed_block::operator= ( const signed_block & )
delete

◆ operator=() [2/2]

signed_block & sysio::chain::signed_block::operator= ( signed_block && )
default

◆ validate_and_extract_extensions()

flat_multimap< uint16_t, block_extension > sysio::chain::signed_block::validate_and_extract_extensions ( ) const

Definition at line 23 of file block.cpp.

23 {
24 using decompose_t = block_extension_types::decompose_t;
25
26 flat_multimap<uint16_t, block_extension> results;
27
28 uint16_t id_type_lower_bound = 0;
29
30 for( size_t i = 0; i < block_extensions.size(); ++i ) {
31 const auto& e = block_extensions[i];
32 auto id = e.first;
33
34 SYS_ASSERT( id >= id_type_lower_bound, invalid_block_extension,
35 "Block extensions are not in the correct order (ascending id types required)"
36 );
37
38 auto iter = results.emplace(std::piecewise_construct,
39 std::forward_as_tuple(id),
40 std::forward_as_tuple()
41 );
42
43 auto match = decompose_t::extract<block_extension>( id, e.second, iter->second );
44 SYS_ASSERT( match, invalid_block_extension,
45 "Block extension with id type ${id} is not supported",
46 ("id", id)
47 );
48
49 if( match->enforce_unique ) {
50 SYS_ASSERT( i == 0 || id > id_type_lower_bound, invalid_block_header_extension,
51 "Block extension with id type ${id} is not allowed to repeat",
52 ("id", id)
53 );
54 }
55
56
57 id_type_lower_bound = id;
58 }
59
60 return results;
61
62 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
uint64_t id
Definition code_cache.cpp:0
unsigned short uint16_t
Definition stdint.h:125
extensions_type block_extensions
new or generated transactions
Definition block.hpp:101
account_query_db::get_accounts_by_authorizers_result results

Member Data Documentation

◆ block_extensions

extensions_type sysio::chain::signed_block::block_extensions

Definition at line 101 of file block.hpp.

◆ transactions

vector<transaction_receipt> sysio::chain::signed_block::transactions

Definition at line 100 of file block.hpp.


The documentation for this struct was generated from the following files: