BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
sliced_lists.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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 
26 
27 #include <fc/reflect/typelist.hpp>
28 
29 namespace graphene { namespace protocol {
30 namespace typelist = fc::typelist;
31 
32 // To make the build gentler on RAM, break the operation list into several pieces to build over several files
33 using operation_list_1 = static_variant<typelist::builder<>
34  ::add<transfer_operation> // 0
35  ::add<limit_order_create_operation> // 1
36  ::add<limit_order_cancel_operation> // 2
37  ::add<call_order_update_operation> // 3
38  ::finalize>;
40  ::add<account_create_operation> // 5
41  ::add<account_update_operation> // 6
42  ::finalize>;
44  ::add<asset_create_operation> // 10
45  ::finalize>;
47  ::add<asset_update_feed_producers_operation> // 13
48  ::add<asset_issue_operation> // 14
49  ::add<asset_reserve_operation> // 15
50  ::finalize>;
52  ::add<asset_publish_feed_operation> // 19
53  ::add<witness_update_operation> // 21
54  ::finalize>;
56  ::add<vesting_balance_create_operation> // 32
57  ::add<vesting_balance_withdraw_operation> // 33
58  ::finalize>;
60  ::add<override_transfer_operation> // 38
61  ::finalize>;
63  ::add<htlc_create_operation> // 49
64  ::add<htlc_redeem_operation> // 50
65  ::add<htlc_extend_operation> // 52
66  ::finalize>;
67 // Note: Since BSIP-40 is not to be enabled on the BitShares Mainnet any time soon,
68 // by now, the list of supported operations ends here.
69 // These operations are used in unit tests.
70 // As of writing, transfer_operation and limit_order_create_operation appeared on the public testnet
71 // between block #31808000 and #31811000.
72 // Other operations are added to the unsupported_operations_list with a comment "Unsupported".
73 // The operations in the unsupported_operations_list with other comments are virtual operations or
74 // unimplemented, so should be kept there anyway.
75 // This is to reduce the compilation time and the size of binaries.
76 // TODO support more operations when we decide to continue BSIP-40 development.
78  ::add<fill_order_operation> // 4 // VIRTUAL
79  ::add<account_whitelist_operation> // 7 // Unsupported
80  ::add<account_upgrade_operation> // 8 // Unsupported
81  ::add<account_transfer_operation> // 9 // Unimplemented
82  ::add<asset_update_operation> // 11 // Unsupported
83  ::add<asset_update_bitasset_operation> // 12 // Unsupported
84  ::add<asset_fund_fee_pool_operation> // 16 // Unsupported
85  ::add<asset_settle_operation> // 17 // Unsupported
86  ::add<asset_global_settle_operation> // 18 // Unsupported
87  ::add<witness_create_operation> // 20 // Unsupported
88  // [22, 32) // Unsupported
90  typelist::index_of< operation::list,
92  typelist::index_of< operation::list,
94  ::add<worker_create_operation> // 34 // Unsupported
95  ::add<custom_operation> // 35 // Unsupported
96  ::add<assert_operation> // 36 // Unsupported
97  ::add<balance_claim_operation> // 37 // Unsupported
98  ::add<transfer_to_blind_operation> // 39 // Unsupported
99  ::add<blind_transfer_operation> // 40 // Unsupported
100  ::add<transfer_from_blind_operation> // 41 // Unsupported
101  ::add<asset_settle_cancel_operation> // 42 // VIRTUAL
102  ::add<asset_claim_fees_operation> // 43 // Unsupported
103  ::add<fba_distribute_operation> // 44 // VIRTUAL
104  ::add<bid_collateral_operation> // 45 // Unsupported
105  ::add<execute_bid_operation> // 46 // VIRTUAL
106  ::add<asset_claim_pool_operation> // 47 // Unsupported
107  ::add<asset_update_issuer_operation> // 48 // Unsupported
108  ::add<htlc_redeemed_operation> // 51 // VIRTUAL
109  ::add<htlc_refund_operation> // 53 // VIRTUAL
110  // New operations are added here // Unsupported
111  ::add_list<typelist::slice<operation::list,
112  typelist::index_of< operation::list,
114  ::finalize>;
115 
116 object_restriction_predicate<operation> get_restriction_pred_list_1(size_t idx, vector<restriction> rs);
117 object_restriction_predicate<operation> get_restriction_pred_list_2(size_t idx, vector<restriction> rs);
118 object_restriction_predicate<operation> get_restriction_pred_list_3(size_t idx, vector<restriction> rs);
119 object_restriction_predicate<operation> get_restriction_pred_list_5(size_t idx, vector<restriction> rs);
120 object_restriction_predicate<operation> get_restriction_pred_list_6(size_t idx, vector<restriction> rs);
121 object_restriction_predicate<operation> get_restriction_pred_list_9(size_t idx, vector<restriction> rs);
124 
125 } } // namespace graphene::protocol
graphene::protocol::get_restriction_pred_list_1
result_type get_restriction_pred_list_1(size_t idx, vector< restriction > rs)
Definition: list_1.cpp:31
fc::typelist::list
The actual list type.
Definition: typelist.hpp:17
fc::typelist::slice
typename impl::slice< list<>, List, start, end >::type slice
Take the sublist at indexes [start, end)
Definition: typelist.hpp:216
graphene::protocol::get_restriction_pred_list_2
result_type get_restriction_pred_list_2(size_t idx, vector< restriction > rs)
Definition: list_2.cpp:32
graphene::protocol::get_restriction_pred_list_3
result_type get_restriction_pred_list_3(size_t idx, vector< restriction > rs)
Definition: list_3.cpp:32
graphene::protocol::vesting_balance_create_operation
Create a vesting balance.
Definition: vesting.hpp:74
graphene::protocol::get_restriction_pred_list_9
result_type get_restriction_pred_list_9(size_t idx, vector< restriction > rs)
Definition: list_9.cpp:32
fc::static_variant
Definition: raw_fwd.hpp:27
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, samet_fund_create_operation, samet_fund_delete_operation, samet_fund_update_operation, samet_fund_borrow_operation, samet_fund_repay_operation, credit_offer_create_operation, credit_offer_delete_operation, credit_offer_update_operation, credit_offer_accept_operation, credit_deal_repay_operation, credit_deal_expired_operation, liquidity_pool_update_operation, credit_deal_update_operation, limit_order_update_operation >::list
typelist::list< Types... > list
Definition: static_variant.hpp:47
graphene::protocol::custom_authority_create_operation
Create a new custom authority.
Definition: custom_authority.hpp:36
graphene::protocol::get_restriction_pred_list_6
result_type get_restriction_pred_list_6(size_t idx, vector< restriction > rs)
Definition: list_6.cpp:32
typelist.hpp
Defines a template for manipulating and storing compile-time lists of types.
fc::typelist
This namespace contains the list type, and all of the operations and queries which can be performed u...
Definition: typelist.hpp:14
operations.hpp
graphene::protocol::get_restriction_pred_list_5
result_type get_restriction_pred_list_5(size_t idx, vector< restriction > rs)
Definition: list_5.cpp:32
graphene::protocol::object_restriction_predicate
std::function< predicate_result(const Field &)> object_restriction_predicate
Definition: restriction_predicate.hxx:69
graphene::protocol::get_restriction_pred_list_10
result_type get_restriction_pred_list_10(size_t idx, vector< restriction > rs)
Definition: list_10.cpp:31
graphene::protocol::operation_list_1
static_variant< typelist::builder<> ::add< transfer_operation > ::add< limit_order_create_operation > ::add< limit_order_cancel_operation > ::add< call_order_update_operation > ::finalize > operation_list_1
Definition: sliced_lists.hxx:38
graphene::protocol::get_restriction_pred_list_11
result_type get_restriction_pred_list_11(size_t idx, vector< restriction > rs)
Definition: list_11.cpp:31
graphene::protocol::proposal_create_operation
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenarios.
Definition: proposal.hpp:70
graphene
Definition: api.cpp:48