BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
operation_history_object.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
25 
27 #include <graphene/db/object.hpp>
28 
29 #include <boost/multi_index/composite_key.hpp>
30 
31 namespace graphene { namespace chain {
32 
48  class operation_history_object : public abstract_object<operation_history_object>
49  {
50  public:
51  static constexpr uint8_t space_id = protocol_ids;
52  static constexpr uint8_t type_id = operation_history_object_type;
53 
56 
60  uint32_t block_num = 0;
62  uint16_t trx_in_block = 0;
64  uint16_t op_in_trx = 0;
66  uint32_t virtual_op = 0;
67  };
68 
90  class account_transaction_history_object : public abstract_object<account_transaction_history_object>
91  {
92  public:
93  static constexpr uint8_t space_id = implementation_ids;
94  static constexpr uint8_t type_id = impl_account_transaction_history_object_type;
95  account_id_type account;
96  operation_history_id_type operation_id;
97  uint64_t sequence = 0;
98  account_transaction_history_id_type next;
99  };
100 
101  typedef multi_index_container<
103  indexed_by<
104  ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >
105  >
107 
109 
110  struct by_seq;
111  struct by_op;
112  struct by_opid;
113 
114  typedef multi_index_container<
116  indexed_by<
117  ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
118  ordered_unique< tag<by_seq>,
119  composite_key< account_transaction_history_object,
120  member< account_transaction_history_object, account_id_type, &account_transaction_history_object::account>,
121  member< account_transaction_history_object, uint64_t, &account_transaction_history_object::sequence>
122  >
123  >,
124  ordered_unique< tag<by_op>,
125  composite_key< account_transaction_history_object,
126  member< account_transaction_history_object, account_id_type, &account_transaction_history_object::account>,
127  member< account_transaction_history_object, operation_history_id_type, &account_transaction_history_object::operation_id>
128  >
129  >,
130  ordered_non_unique< tag<by_opid>,
131  member< account_transaction_history_object, operation_history_id_type, &account_transaction_history_object::operation_id>
132  >
133  >
135 
137 
138 
139 } } // graphene::chain
140 
143 
146 
tracks the history of all logical operations on blockchain stateAll operations and virtual operations...
Definition: api.cpp:56
a node in a linked list of operation_history_objectsAccount history is important for users and wallet...
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
Definition: object_id.hpp:98
generic_index< account_transaction_history_object, account_transaction_history_multi_index_type > account_transaction_history_index
fc::static_variant< transfer_operation, limit_order_create_operation, limit_order_cancel_operation, call_order_update_operation, fill_order_operation, account_create_operation, account_update_operation, account_whitelist_operation, account_upgrade_operation, account_transfer_operation, asset_create_operation, asset_update_operation, asset_update_bitasset_operation, asset_update_feed_producers_operation, asset_issue_operation, asset_reserve_operation, asset_fund_fee_pool_operation, asset_settle_operation, asset_global_settle_operation, asset_publish_feed_operation, witness_create_operation, witness_update_operation, proposal_create_operation, proposal_update_operation, proposal_delete_operation, withdraw_permission_create_operation, withdraw_permission_update_operation, withdraw_permission_claim_operation, withdraw_permission_delete_operation, committee_member_create_operation, committee_member_update_operation, committee_member_update_global_parameters_operation, vesting_balance_create_operation, vesting_balance_withdraw_operation, worker_create_operation, custom_operation, assert_operation, balance_claim_operation, override_transfer_operation, transfer_to_blind_operation, blind_transfer_operation, transfer_from_blind_operation, asset_settle_cancel_operation, asset_claim_fees_operation, fba_distribute_operation, bid_collateral_operation, execute_bid_operation, asset_claim_pool_operation, asset_update_issuer_operation, htlc_create_operation, htlc_redeem_operation, htlc_redeemed_operation, htlc_extend_operation, htlc_refund_operation, custom_authority_create_operation, custom_authority_update_operation, custom_authority_delete_operation, ticket_create_operation, ticket_update_operation, liquidity_pool_create_operation, liquidity_pool_delete_operation, liquidity_pool_deposit_operation, liquidity_pool_withdraw_operation, liquidity_pool_exchange_operation >
multi_index_container< account_transaction_history_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type,&object::id > >, ordered_unique< tag< by_seq >, composite_key< account_transaction_history_object, member< account_transaction_history_object, account_id_type,&account_transaction_history_object::account >, member< account_transaction_history_object, uint64_t,&account_transaction_history_object::sequence > > >, ordered_unique< tag< by_op >, composite_key< account_transaction_history_object, member< account_transaction_history_object, account_id_type,&account_transaction_history_object::account >, member< account_transaction_history_object, operation_history_id_type,&account_transaction_history_object::operation_id > > >, ordered_non_unique< tag< by_opid >, member< account_transaction_history_object, operation_history_id_type,&account_transaction_history_object::operation_id > > > > account_transaction_history_multi_index_type
FC_REFLECT_TYPENAME(fc::log_message)
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:73
Use the Curiously Recurring Template Pattern to automatically add the ability to clone, serialize, and move objects polymorphically.
Definition: object.hpp:86
account_transaction_history_id_type next
the operation position within the given account
generic_index< operation_history_object, operation_history_multi_index_type > operation_history_index
multi_index_container< operation_history_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type,&object::id > > > > operation_history_multi_index_type
operation_history_id_type operation_id
the account this operation applies to