Skip to content

Commit

Permalink
Add HF7 remove invalid abused accounts, add evaluators and operations…
Browse files Browse the repository at this point in the history
… in account_history plugin
  • Loading branch information
On1x committed Apr 26, 2019
1 parent fdda77f commit 7921fcc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,9 @@ namespace graphene { namespace chain {
_my->_evaluator_registry.register_evaluator<award_evaluator>();
_my->_evaluator_registry.register_evaluator<set_paid_subscription_evaluator>();
_my->_evaluator_registry.register_evaluator<paid_subscribe_evaluator>();
_my->_evaluator_registry.register_evaluator<set_account_price_evaluator>();
_my->_evaluator_registry.register_evaluator<set_subaccount_price_evaluator>();
_my->_evaluator_registry.register_evaluator<buy_account_evaluator>();
}

void database::set_custom_operation_interpreter(const std::string &id, std::shared_ptr<custom_operation_interpreter> registry) {
Expand Down Expand Up @@ -4019,7 +4022,7 @@ namespace graphene { namespace chain {
adjust_proxied_witness_votes(get_account(current.name), delta);
}
//move shares and balance to committee
elog("- add to committee funds: ${a} SHARES, ${b} TOKEN", ("a", current.vesting_shares), ("b", current.balance));
elog("- add to committee funds: ${a} SHARES, ${b} TOKEN", ("a", current.vesting_shares)("b", current.balance));
modify(committee_account, [&](account_object &a) {
a.vesting_shares += current.vesting_shares;
a.balance += current.balance;
Expand Down
4 changes: 4 additions & 0 deletions libraries/chain/include/graphene/chain/chain_evaluator.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <graphene/protocol/authority.hpp>
#include <graphene/protocol/chain_operations.hpp>
#include <graphene/protocol/proposal_operations.hpp>
#include <graphene/chain/evaluator.hpp>
Expand Down Expand Up @@ -44,6 +45,9 @@ namespace graphene { namespace chain {
DEFINE_EVALUATOR(award)
DEFINE_EVALUATOR(set_paid_subscription)
DEFINE_EVALUATOR(paid_subscribe)
DEFINE_EVALUATOR(set_account_price)
DEFINE_EVALUATOR(set_subaccount_price)
DEFINE_EVALUATOR(buy_account)

class proposal_create_evaluator: public evaluator_impl<proposal_create_evaluator> {
public:
Expand Down
18 changes: 18 additions & 0 deletions plugins/account_history/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,24 @@ if( options.count(name) ) { \
impacted.insert(op.subscriber);
impacted.insert(op.account);
}
void operator()(const set_account_price_operation& op) {
impacted.insert(op.account);
}
void operator()(const set_subaccount_price_operation& op) {
impacted.insert(op.account);
}
void operator()(const buy_account_operation& op) {
impacted.insert(op.buyer);
}
void operator()(const account_sale_operation& op) {
impacted.insert(op.buyer);
impacted.insert(op.seller);
impacted.insert(op.account);
}
//void operator()( const operation& op ){}
};
Expand Down

0 comments on commit 7921fcc

Please sign in to comment.