Scorum
witnesses_initializator.cpp
Go to the documentation of this file.
3 
4 #include <fc/exception/exception.hpp>
5 
8 
11 
13 
14 namespace scorum {
15 namespace chain {
16 namespace genesis {
17 
19 {
20  account_service_i& account_service = ctx.services().account_service();
21  witness_service_i& witness_service = ctx.services().witness_service();
22 
23  for (auto& witness : ctx.genesis_state().witness_candidates)
24  {
25  FC_ASSERT(!witness.name.empty(), "Witness 'name' should not be empty.");
26 
27  account_service.check_account_existence(witness.name);
28 
29  FC_ASSERT(witness.block_signing_key != public_key_type(), "Witness 'block_signing_key' should not be empty.");
30 
31  witness_service.create_initial_witness(witness.name, witness.block_signing_key);
32  }
33 }
34 }
35 }
36 }
const genesis_state_type & genesis_state() const
data_service_factory_i & services() const
Definition: asset.cpp:15
virtual void check_account_existence(const account_name_type &, const optional< const char * > &context_type_name=optional< const char * >()) const =0
std::vector< witness_type > witness_candidates
virtual const witness_object & create_initial_witness(const account_name_type &owner, const public_key_type &block_signing_key)=0