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

Commit

Permalink
Ref #15: Cleanup a bit
Browse files Browse the repository at this point in the history
The contract handlers that need the database get a reference to it in
the context. I don't need to pass another db reference to them. Fix
this.
  • Loading branch information
nathanielhourt committed Apr 27, 2017
1 parent ed7cb32 commit f3d1450
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ void native_system_contract_plugin::plugin_shutdown() {

void native_system_contract_plugin::install(database& db) {
#define SET_HANDLERS(name) \
db.set_validate_handler("sys", "sys", #name, \
[&db](chain::message_validate_context& c) mutable { name ## _validate(c); }); \
db.set_precondition_validate_handler("sys", "sys", #name, \
[&db](chain::precondition_validate_context& c) mutable { name ## _validate_preconditions(c); }); \
db.set_apply_handler("sys", "sys", #name, \
[&db](chain::apply_context& c) mutable { name ## _apply(c); })
db.set_validate_handler("sys", "sys", #name, &name ## _validate); \
db.set_precondition_validate_handler("sys", "sys", #name, &name ## _validate_preconditions); \
db.set_apply_handler("sys", "sys", #name, &name ## _apply)

SET_HANDLERS(Transfer);
}
Expand Down

0 comments on commit f3d1450

Please sign in to comment.