This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Initial Transaction API #130
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1476206
Added account history plugin
brianjohnson5972 991165e
Added account history processing to applications
brianjohnson5972 65c1ceb
Added plugins to cmake and removed unintended commit
brianjohnson5972 a251af2
Moved transaction tracking into database
brianjohnson5972 3122cab
Updating chainbase submodule
brianjohnson5972 69f0bb1
Merged in upstream changes
brianjohnson5972 4a4026e
Moved object and multi index definition to its own header file and ad…
brianjohnson5972 91da030
Minor review fixes
brianjohnson5972 809bb82
Removed erroneous word in comment
brianjohnson5972 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
plugins/account_history_plugin/include/eos/account_history_plugin/account_history_object.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include <chainbase/chainbase.hpp> | ||
|
||
namespace eos { | ||
using chain::block_id_type; | ||
using chain::transaction_id_type; | ||
using namespace boost::multi_index; | ||
|
||
class transaction_history_object : public chainbase::object<chain::transaction_history_object_type, transaction_history_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<tag<by_id>, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_history_object::id_type, id)>, | ||
hashed_unique<tag<by_trx_id>, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_id_type, transaction_id), std::hash<transaction_id_type>> | ||
> | ||
>; | ||
|
||
typedef chainbase::generic_index<transaction_history_multi_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) ) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Defined by account_history_plugin"