Scorum
adjust_nft_experience_evaluator.cpp
Go to the documentation of this file.
2 
5 
11 
12 namespace scorum {
13 namespace chain {
14 
18  : evaluator_impl<data_service_factory_i, adjust_nft_experience_evaluator>(services)
19  , _account_dba(account_dba)
20  , _nft_dba(nft_dba)
21  , _hardfork_service(services.hardfork_property_service())
22 {
23 }
24 
26 {
27  FC_ASSERT(_hardfork_service.has_hardfork(SCORUM_HARDFORK_0_6), "Hardfork #6 is required");
28  FC_ASSERT(_nft_dba.is_exists_by<by_uuid>(op.uuid), R"(NFT with uuid "${uuid}" must exist.)", ("uuid", op.uuid));
29  FC_ASSERT(_account_dba.is_exists_by<by_name>(op.moderator), R"(Account "${moderator}" must exist.)",
30  ("moderator", op.moderator));
31 
32  auto& nft = _nft_dba.get_by<by_uuid>(op.uuid);
33  _nft_dba.update(nft, [&](auto& nft) { nft.experience += op.experience; });
34 }
35 
36 } // namespace chain
37 } // namespace scorum
adjust_nft_experience_evaluator(data_service_factory_i &, dba::db_accessor< account_object > &, dba::db_accessor< nft_object > &)
bool is_exists_by(const Key &arg) const
Definition: asset.cpp:15
virtual bool has_hardfork(uint32_t hardfork) const =0