Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
add signals for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
b1bart committed Sep 10, 2018
1 parent 5318041 commit e2ec9f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ struct controller_impl {
*
*/
template<typename Signal, typename Arg>
void emit( const Signal& s, Arg&& a ) {
void emit( const Signal& s, Arg&& a ) const {
try {
s(std::forward<Arg>(a));
} catch (boost::interprocess::bad_alloc& e) {
Expand Down Expand Up @@ -462,6 +462,8 @@ struct controller_impl {

authorization.add_to_snapshot(snapshot);
resource_limits.add_to_snapshot(snapshot);

emit(self.write_snapshot, snapshot);
}

void print_json_snapshot() const {
Expand All @@ -484,6 +486,8 @@ struct controller_impl {

authorization.read_from_snapshot(snapshot);
resource_limits.read_from_snapshot(snapshot);

emit(self.read_snapshot, snapshot);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace chainbase {
namespace eosio { namespace chain {

class authorization_manager;
class snapshot_reader;
class snapshot_writer;

namespace resource_limits {
class resource_limits_manager;
Expand Down Expand Up @@ -254,6 +256,9 @@ namespace eosio { namespace chain {
signal<void(const transaction_trace_ptr&)> post_apply_action;
*/

signal<void(snapshot_writer&)> write_snapshot;
signal<void(snapshot_reader&)> read_snapshot;

const apply_handler* find_apply_handler( account_name contract, scope_name scope, action_name act )const;
wasm_interface& get_wasm_interface();

Expand Down

0 comments on commit e2ec9f9

Please sign in to comment.