diff --git a/libraries/chain/custom_authority_evaluator.cpp b/libraries/chain/custom_authority_evaluator.cpp index 7c3ce30de7..dcba31dff1 100644 --- a/libraries/chain/custom_authority_evaluator.cpp +++ b/libraries/chain/custom_authority_evaluator.cpp @@ -56,7 +56,7 @@ void_result custom_authority_create_evaluator::do_evaluate(const custom_authorit FC_ASSERT(std::distance(range.first, range.second) < config->max_custom_authorities_per_account, "Cannot create custom authority for account: account already has maximum number"); - predicate = get_restriction_predicate(op.restrictions, op.operation_type); + get_restriction_predicate(op.restrictions, op.operation_type); return void_result(); } FC_CAPTURE_AND_RETHROW((op)) } @@ -64,7 +64,7 @@ object_id_type custom_authority_create_evaluator::do_apply(const custom_authorit { try { database& d = db(); - return d.create([&op, p=std::move(predicate)] (custom_authority_object& obj) mutable { + return d.create([&op] (custom_authority_object& obj) mutable { obj.account = op.account; obj.enabled = op.enabled; obj.valid_from = op.valid_from; diff --git a/libraries/chain/include/graphene/chain/custom_authority_evaluator.hpp b/libraries/chain/include/graphene/chain/custom_authority_evaluator.hpp index 4eebf70a59..3d33db1a7a 100644 --- a/libraries/chain/include/graphene/chain/custom_authority_evaluator.hpp +++ b/libraries/chain/include/graphene/chain/custom_authority_evaluator.hpp @@ -33,7 +33,6 @@ class custom_authority_object; class custom_authority_create_evaluator : public evaluator { public: using operation_type = custom_authority_create_operation; - restriction_predicate_function predicate; void_result do_evaluate(const operation_type& op); object_id_type do_apply(const operation_type& op); diff --git a/libraries/protocol/custom_authorities/restriction_predicate.hxx b/libraries/protocol/custom_authorities/restriction_predicate.hxx index 1c583a4b51..e5335bbb48 100644 --- a/libraries/protocol/custom_authorities/restriction_predicate.hxx +++ b/libraries/protocol/custom_authorities/restriction_predicate.hxx @@ -497,7 +497,7 @@ object_restriction_predicate create_field_predicate(restriction&& r, sho auto p = create_predicate_function(static_cast(f), std::move(a)); return [p=std::move(p)](const Object& o) { return p(FieldReflection::get(o)); }; }; - return typelist::runtime::dispatch(member_list(), r.member_index, predicator); + return typelist::runtime::dispatch(member_list(), r.member_index.value, predicator); } template object_restriction_predicate create_field_predicate(restriction&&, long) { diff --git a/libraries/protocol/custom_authority.cpp b/libraries/protocol/custom_authority.cpp index b91233ec64..2a6559c3e1 100644 --- a/libraries/protocol/custom_authority.cpp +++ b/libraries/protocol/custom_authority.cpp @@ -25,6 +25,8 @@ #include #include +#include + namespace graphene { namespace protocol { share_type custom_authority_create_operation::calculate_fee(const fee_parameters_type& k)const { diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index e25b4f76e0..43278182e2 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -1383,14 +1384,15 @@ void database_fixture::set_htlc_committee_parameters() std::shared_ptr new_fee_schedule = std::make_shared(); new_fee_schedule->scale = GRAPHENE_100_PERCENT; // replace the old with the new - flat_map params_map = get_htlc_fee_parameters(); + flat_map htlc_fees = get_htlc_fee_parameters(); for(auto param : existing_fee_schedule.parameters) { - auto itr = params_map.find(param.which()); - if (itr == params_map.end()) - new_fee_schedule->parameters.insert(param); - else - { + auto itr = htlc_fees.find(param.which()); + if (itr == htlc_fees.end()) { + // Only define fees for operations which are already forked in! + if (hardfork_visitor(db.head_block_time()).visit(param.which())) + new_fee_schedule->parameters.insert(param); + } else { new_fee_schedule->parameters.insert( (*itr).second); } }