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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from brianjohnson5972/lkup_by_acct_ctrl_167
Added lookup of controlled accounts by controlling account name.
- Loading branch information
Showing
6 changed files
with
133 additions
and
13 deletions.
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
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
47 changes: 47 additions & 0 deletions
47
...ount_history_plugin/include/eos/account_history_plugin/account_control_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,47 @@ | ||
#pragma once | ||
|
||
#include <chainbase/chainbase.hpp> | ||
#include <eos/chain/types.hpp> | ||
|
||
namespace eos { | ||
using chain::AccountName; | ||
using chain::PermissionName; | ||
using chain::shared_vector; | ||
using chain::transaction_id_type; | ||
using namespace boost::multi_index; | ||
|
||
class account_control_history_object : public chainbase::object<chain::account_control_history_object_type, account_control_history_object> { | ||
OBJECT_CTOR(account_control_history_object) | ||
|
||
id_type id; | ||
AccountName controlled_account; | ||
PermissionName controlled_permission; | ||
AccountName controlling_account; | ||
}; | ||
|
||
struct by_id; | ||
struct by_controlling; | ||
struct by_controlled_authority; | ||
using account_control_history_multi_index = chainbase::shared_multi_index_container< | ||
account_control_history_object, | ||
indexed_by< | ||
ordered_unique<tag<by_id>, BOOST_MULTI_INDEX_MEMBER(account_control_history_object, account_control_history_object::id_type, id)>, | ||
hashed_non_unique<tag<by_controlling>, BOOST_MULTI_INDEX_MEMBER(account_control_history_object, AccountName, controlling_account), std::hash<AccountName>>, | ||
hashed_non_unique<tag<by_controlled_authority>, | ||
composite_key< account_control_history_object, | ||
member<account_control_history_object, AccountName, &account_control_history_object::controlled_account>, | ||
member<account_control_history_object, PermissionName, &account_control_history_object::controlled_permission> | ||
>, | ||
composite_key_hash< std::hash<AccountName>, std::hash<PermissionName> > | ||
> | ||
> | ||
>; | ||
|
||
typedef chainbase::generic_index<account_control_history_multi_index> account_control_history_index; | ||
|
||
} | ||
|
||
CHAINBASE_SET_INDEX_TYPE( eos::account_control_history_object, eos::account_control_history_multi_index ) | ||
|
||
FC_REFLECT( eos::account_control_history_object, (controlled_account)(controlled_permission)(controlling_account) ) | ||
|
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