16 constexpr eosio::name
CREATED =
"created"_n;
46typedef eosio::multi_index<
48 indexed_by<
"byusername"_n, const_mem_fun<commit, uint64_t, &commit::by_username>>,
49 indexed_by<
"byhash"_n, const_mem_fun<commit, checksum256, &commit::by_commit_hash>>,
50 indexed_by<
"byprojhash"_n, const_mem_fun<commit, checksum256, &commit::by_project_hash>>
61 inline std::optional<commit>
get_commit(eosio::name coopname,
const checksum256 &hash) {
83 eosio::check(
commit.has_value(),
"Коммит не найден");
93inline void delete_commit(eosio::name coopname,
const checksum256 &hash) {
98 eosio::check(itr !=
commit_index.end(),
"Коммит не найден");
112 eosio::name coopname,
113 eosio::name username,
114 checksum256 project_hash,
115 checksum256 commit_hash,
123 commits.emplace(coopname, [&](
auto &c) {
126 c.coopname = coopname;
127 c.username = username;
128 c.project_hash = project_hash;
129 c.commit_hash = commit_hash;
130 c.amounts = calculated_fact;
131 c.created_at = current_time_point();
static constexpr eosio::name _capital
Definition: consts.hpp:150
contract
Definition: eosio.msig_tests.cpp:977
uint64_t get_global_id_in_scope(eosio::name _me, eosio::name scope, eosio::name key)
Definition: counts.hpp:61
constexpr eosio::name CREATED
Коммит создан
Definition: commits.hpp:16
Definition: commits.hpp:8
void create_commit(eosio::name coopname, eosio::name username, checksum256 project_hash, checksum256 commit_hash, const generation_amounts &calculated_fact)
Создает коммит без отправки на утверждение.
Definition: commits.hpp:111
eosio::multi_index< "commits"_n, commit, indexed_by<"byusername"_n, const_mem_fun< commit, uint64_t, &commit::by_username > >, indexed_by<"byhash"_n, const_mem_fun< commit, checksum256, &commit::by_commit_hash > >, indexed_by<"byprojhash"_n, const_mem_fun< commit, checksum256, &commit::by_project_hash > > > commit_index
Definition: commits.hpp:51
void delete_commit(eosio::name coopname, const checksum256 &hash)
Удаляет коммит по хэшу действия.
Definition: commits.hpp:93
commit get_commit_or_fail(eosio::name coopname, const checksum256 &hash)
Получает действие по хэшу действия.
Definition: commits.hpp:81
std::optional< commit > get_commit(eosio::name coopname, const checksum256 &hash)
Получает действие по хэшу действия.
Definition: commits.hpp:61
Definition: eosio.msig.hpp:34
Таблица коммитов хранит данные о выполненных операциях в проекте.
Definition: commits.hpp:30
checksum256 by_commit_hash() const
Индекс по хэшу коммита (3)
Definition: commits.hpp:42
checksum256 project_hash
Хэш проекта, связанного с действием
Definition: commits.hpp:35
time_point_sec created_at
Дата и время создания действия
Definition: commits.hpp:38
checksum256 commit_hash
Хэш действия
Definition: commits.hpp:36
generation_amounts amounts
Рассчитанные показатели генерации
Definition: commits.hpp:37
uint64_t primary_key() const
Первичный ключ (1)
Definition: commits.hpp:40
name username
Имя пользователя, совершившего действие
Definition: commits.hpp:33
uint64_t by_username() const
Индекс по имени пользователя (2)
Definition: commits.hpp:41
uint64_t id
ID коммита (внутренний ключ)
Definition: commits.hpp:31
name coopname
Имя кооператива
Definition: commits.hpp:32
checksum256 by_project_hash() const
Индекс по хэшу проекта (4)
Definition: commits.hpp:43
name status
Статус коммита (created | approved | authorized | act1 | act2)
Definition: commits.hpp:34
Структура для результатов расчета генерации коммита Содержит только те поля, которые рассчитываются п...
Definition: generation_amounts.hpp:14