Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
finality_status_object.hpp
Go to the documentation of this file.
1#pragma once
5#include <boost/multi_index/hashed_index.hpp>
6
7namespace bmi = boost::multi_index;
8
9namespace sysio {
19 {
21 fc::time_point trx_expiry; // if block time past trx_expiry && !block_num -> in failed list
25 bool forked_out = false; // if !block_num && forked_out -> status == "forked out"
26
27 size_t memory_size() const { return sizeof(*this); }
28 bool is_in_block() const {
30 }
32 };
33
34 namespace finality_status {
35 struct by_trx_id;
36 struct by_status_expiry;
37 struct by_block_num;
38
40
41 constexpr uint32_t no_block_num = 0;
42 }
43
44 using finality_status_multi_index = boost::multi_index_container<
46 indexed_by<
47 bmi::hashed_unique< tag<finality_status::by_trx_id>,
48 member<finality_status_object, chain::transaction_id_type, &finality_status_object::trx_id> >,
49 ordered_non_unique< tag<finality_status::by_status_expiry>,
50 composite_key< finality_status_object,
51 const_mem_fun<finality_status_object, bool, &finality_status_object::is_in_block>,
52 member< finality_status_object, fc::time_point, &finality_status_object::received >
53 >
54 >,
55 ordered_non_unique< tag<finality_status::by_block_num>,
56 const_mem_fun<finality_status_object, uint32_t, &finality_status_object::block_num> >
57 >
58 >;
59
60}
61
62FC_REFLECT( sysio::finality_status_object, (trx_id)(trx_expiry)(received)(block_id)(block_timestamp)(forked_out) )
boost::multi_index_container< finality_status_object, indexed_by< bmi::hashed_unique< tag< finality_status::by_trx_id >, member< finality_status_object, chain::transaction_id_type, &finality_status_object::trx_id > >, ordered_non_unique< tag< finality_status::by_status_expiry >, composite_key< finality_status_object, const_mem_fun< finality_status_object, bool, &finality_status_object::is_in_block >, member< finality_status_object, fc::time_point, &finality_status_object::received > > >, ordered_non_unique< tag< finality_status::by_block_num >, const_mem_fun< finality_status_object, uint32_t, &finality_status_object::block_num > > > > finality_status_multi_index
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
bool received
unsigned int uint32_t
Definition stdint.h:126
static uint32_t num_from_id(const block_id_type &id)
tracks status related to a transaction in the blockchain
chain::transaction_id_type trx_id
chain::block_timestamp_type block_timestamp