hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
utils.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_VALIDATION_UTILS
7 #define IROHA_VALIDATION_UTILS
8 
9 #include <string>
10 #include <vector>
11 
12 #include <boost/range/any_range.hpp>
13 
16 
17 namespace iroha {
18  namespace validation {
26  inline bool signaturesSubset(
28  const boost::any_range<shared_model::crypto::PublicKey,
29  boost::forward_traversal_tag> &public_keys) {
30  return std::all_of(
31  signatures.begin(),
32  signatures.end(),
33  [&public_keys](const auto &signature) {
34  return std::find_if(public_keys.begin(),
35  public_keys.end(),
36  [&signature](const auto &public_key) {
37  return signature.publicKey() == public_key;
38  })
39  != public_keys.end();
40  });
41  }
42 
43  } // namespace validation
44 } // namespace iroha
45 
46 #endif // IROHA_VALIDATION_UTILS
bool signaturesSubset(const shared_model::interface::types::SignatureRangeType &signatures, const boost::any_range< shared_model::crypto::PublicKey, boost::forward_traversal_tag > &public_keys)
Definition: utils.hpp:26
boost::any_range< interface::Signature, boost::forward_traversal_tag, const Signature & > SignatureRangeType
Type of signature range, which returns when signatures are invoked.
Definition: range_types.hpp:24
Definition: block_query.hpp:16
Definition: public_key.hpp:16