diff --git a/libraries/chain/include/eos/chain/types.hpp b/libraries/chain/include/eos/chain/types.hpp index 8813e7c560a..a121d3c199f 100644 --- a/libraries/chain/include/eos/chain/types.hpp +++ b/libraries/chain/include/eos/chain/types.hpp @@ -171,7 +171,7 @@ namespace eos { namespace chain { transaction_object_type, producer_object_type, chain_property_object_type, - transaction_history_object_type, + transaction_history_object_type, ///< Defined by account history plugin library balance_object_type, ///< Defined by native_contract library staked_balance_object_type, ///< Defined by native_contract library producer_votes_object_type, ///< Defined by native_contract library diff --git a/plugins/account_history_plugin/account_history_plugin.cpp b/plugins/account_history_plugin/account_history_plugin.cpp index 4a263aab27e..9c1a2f57f61 100644 --- a/plugins/account_history_plugin/account_history_plugin.cpp +++ b/plugins/account_history_plugin/account_history_plugin.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -13,6 +14,8 @@ #include #include +namespace fc { class variant; } + namespace eos { using chain::block_id_type; @@ -22,26 +25,6 @@ using boost::multi_index_container; using chain::transaction_id_type; using namespace boost::multi_index; -class transaction_history_object : public chainbase::object { - OBJECT_CTOR(transaction_history_object) - - id_type id; - block_id_type block_id; - transaction_id_type transaction_id; -}; - -struct by_id; -struct by_trx_id; -using transaction_history_multi_index = chainbase::shared_multi_index_container< - transaction_history_object, - indexed_by< - ordered_unique, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_history_object::id_type, id)>, - hashed_unique, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_id_type, transaction_id), std::hash> - > ->; - -typedef chainbase::generic_index transaction_history_index; - class account_history_plugin_impl { public: ProcessedTransaction get_transaction(const chain::transaction_id_type& transaction_id) const; @@ -151,7 +134,3 @@ read_only::get_transaction_results read_only::get_transaction(const read_only::g } // namespace account_history_apis } // namespace eos - -CHAINBASE_SET_INDEX_TYPE( eos::transaction_history_object, eos::transaction_history_multi_index ) - -FC_REFLECT( eos::transaction_history_object, (block_id)(transaction_id) ) diff --git a/plugins/account_history_plugin/include/eos/account_history_plugin/account_history_object.hpp b/plugins/account_history_plugin/include/eos/account_history_plugin/account_history_object.hpp new file mode 100644 index 00000000000..2b6ab38a7a1 --- /dev/null +++ b/plugins/account_history_plugin/include/eos/account_history_plugin/account_history_object.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include + +namespace eos { +using chain::block_id_type; +using chain::transaction_id_type; +using namespace boost::multi_index; + +class transaction_history_object : public chainbase::object { + OBJECT_CTOR(transaction_history_object) + + id_type id; + block_id_type block_id; + transaction_id_type transaction_id; +}; + +struct by_id; +struct by_trx_id; +using transaction_history_multi_index = chainbase::shared_multi_index_container< + transaction_history_object, + indexed_by< + ordered_unique, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_history_object::id_type, id)>, + hashed_unique, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_id_type, transaction_id), std::hash> + > +>; + +typedef chainbase::generic_index transaction_history_index; + +} + +CHAINBASE_SET_INDEX_TYPE( eos::transaction_history_object, eos::transaction_history_multi_index ) + +FC_REFLECT( eos::transaction_history_object, (block_id)(transaction_id) ) +