Skip to content

Commit

Permalink
Template verify_authority steemit#1674
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandeberg committed Dec 12, 2017
1 parent 46e5f91 commit fc7f500
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions libraries/protocol/include/steemit/protocol/transaction_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

namespace steemit { namespace protocol {

void verify_authority( const vector<operation>& ops, const flat_set<public_key_type>& sigs,
template< typename AuthContainerType >
void verify_authority( const vector<AuthContainerType>& auth_containers, const flat_set<public_key_type>& sigs,
const authority_getter& get_active,
const authority_getter& get_owner,
const authority_getter& get_posting,
Expand All @@ -20,8 +21,10 @@ void verify_authority( const vector<operation>& ops, const flat_set<public_key_t
flat_set< account_name_type > required_posting;
vector< authority > other;

for( const auto& op : ops )
operation_get_required_authorities( op, required_active, required_owner, required_posting, other );
get_required_auth_visitor auth_visitor( required_active, required_owner, required_posting, other );

for( const auto& a : auth_containers )
auth_visitor( a );

/**
* Transactions with operations required posting authority cannot be combined
Expand Down Expand Up @@ -91,6 +94,6 @@ void verify_authority( const vector<operation>& ops, const flat_set<public_key_t
tx_irrelevant_sig,
"Unnecessary signature(s) detected"
);
} FC_CAPTURE_AND_RETHROW( (ops)(sigs) ) }
} FC_CAPTURE_AND_RETHROW( (auth_containers)(sigs) ) }

} } // steemit::protocol

0 comments on commit fc7f500

Please sign in to comment.