Scorum
create_game_round_evaluator.cpp
Go to the documentation of this file.
2 
5 
11 
12 namespace scorum {
13 namespace chain {
17  : evaluator_impl<data_service_factory_i, create_game_round_evaluator>(services)
18  , _account_dba(account_dba)
19  , _game_round_dba(game_round_dba)
20  , _hardfork_service(services.hardfork_property_service())
21 {
22 }
23 
25 {
26  FC_ASSERT(_hardfork_service.has_hardfork(SCORUM_HARDFORK_0_5), "Hardfork #5 is required");
27  FC_ASSERT(!_hardfork_service.has_hardfork(SCORUM_HARDFORK_0_6), "Disabled since hardfork #6");
28 
29  FC_ASSERT(!_game_round_dba.is_exists_by<by_uuid>(op.uuid), R"(Round with uuid "${uuid}" already exist.)", ("uuid", op.uuid));
30  FC_ASSERT(_account_dba.is_exists_by<by_name>(op.owner), R"(Account "${owner}" must exist.)", ("owner", op.owner));
31 
32  _game_round_dba.create([&](auto& obj) {
33  obj.uuid = op.uuid;
34  obj.owner = op.owner;
35 
36  fc::from_string(obj.seed, op.seed);
37  fc::from_string(obj.verification_key, op.verification_key);
38  });
39 }
40 
41 } // namespace chain
42 } // namespace scorum
create_game_round_evaluator(data_service_factory_i &, dba::db_accessor< account_object > &, dba::db_accessor< game_round_object > &)
bool is_exists_by(const Key &arg) const
Definition: asset.cpp:15
virtual bool has_hardfork(uint32_t hardfork) const =0
This operation create new game round.