Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
block.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace sysio { namespace chain {
6
32
34
37 explicit transaction_receipt( const packed_transaction& ptrx ):transaction_receipt_header(executed),trx(std::in_place_type<packed_transaction>, ptrx){}
38
39 std::variant<transaction_id_type, packed_transaction> trx;
40
43 fc::raw::pack( enc, status );
46 if( std::holds_alternative<transaction_id_type>(trx) )
47 fc::raw::pack( enc, std::get<transaction_id_type>(trx) );
48 else
49 fc::raw::pack( enc, std::get<packed_transaction>(trx).packed_digest() );
50 return enc.result();
51 }
52 };
53
55 static constexpr uint16_t extension_id() { return 2; }
56 static constexpr bool enforce_unique() { return true; }
57
59
61 :signatures( signatures )
62 {}
63
65 :signatures( std::move(signatures) )
66 {}
67
68 void reflector_init();
69
71 };
72
73 namespace detail {
74 template<typename... Ts>
76 using block_extension_t = std::variant< Ts... >;
77 using decompose_t = decompose< Ts... >;
78 };
79 }
80
83 >;
84
86
90 private:
91 signed_block( const signed_block& ) = default;
92 public:
93 signed_block() = default;
95 signed_block( signed_block&& ) = default;
98 signed_block clone() const { return *this; }
99
102
103 flat_multimap<uint16_t, block_extension> validate_and_extract_extensions()const;
104 };
105 using signed_block_ptr = std::shared_ptr<signed_block>;
106
113
114} }
115
117 (executed)(soft_fail)(hard_fail)(delayed)(expired) )
118
119FC_REFLECT(sysio::chain::transaction_receipt_header, (status)(cpu_usage_us)(net_usage_words) )
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
Definition name.hpp:106
std::shared_ptr< signed_block > signed_block_ptr
Definition block.hpp:105
block_extension_types::block_extension_t block_extension
Definition block.hpp:85
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
#define FC_REFLECT_ENUM(ENUM, FIELDS)
Definition reflect.hpp:194
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
Definition reflect.hpp:298
unsigned short uint16_t
Definition stdint.h:125
unsigned int uint32_t
Definition stdint.h:126
additional_block_signatures_extension(vector< signature_type > &&signatures)
Definition block.hpp:64
additional_block_signatures_extension(const vector< signature_type > &signatures)
Definition block.hpp:60
std::variant< Ts... > block_extension_t
Definition block.hpp:76
Immutable except for fc::from_variant.
Definition name.hpp:43
signed_block(const signed_block_header &h)
Definition block.hpp:94
signed_block clone() const
Definition block.hpp:98
signed_block & operator=(signed_block &&)=default
extensions_type block_extensions
new or generated transactions
Definition block.hpp:101
vector< transaction_receipt > transactions
Definition block.hpp:100
signed_block(signed_block &&)=default
flat_multimap< uint16_t, block_extension > validate_and_extract_extensions() const
Definition block.cpp:23
signed_block & operator=(const signed_block &)=delete
@ delayed
transaction delayed/deferred/scheduled for future execution
Definition block.hpp:17
@ soft_fail
objectively failed (not executed), error handler executed
Definition block.hpp:15
@ hard_fail
objectively failed and error handler objectively failed thus no state change
Definition block.hpp:16
@ expired
transaction expired and storage space refuned to user
Definition block.hpp:18
friend bool operator==(const transaction_receipt_header &lhs, const transaction_receipt_header &rhs)
Definition block.hpp:24
fc::unsigned_int net_usage_words
total billed NET usage, so we can reconstruct resource state when skipping context free data....
Definition block.hpp:30
fc::enum_type< uint8_t, status_enum > status
Definition block.hpp:28
uint32_t cpu_usage_us
total billed CPU usage (microseconds)
Definition block.hpp:29
std::variant< transaction_id_type, packed_transaction > trx
Definition block.hpp:39
transaction_receipt(const transaction_id_type &tid)
Definition block.hpp:36
transaction_receipt(const packed_transaction &ptrx)
Definition block.hpp:37
digest_type digest() const
Definition block.hpp:41
char * s