16 constexpr eosio::name
CREATED =
"created"_n;
48typedef eosio::multi_index<
50 indexed_by<
"byusername"_n, const_mem_fun<commit, uint64_t, &commit::by_username>>,
51 indexed_by<
"byhash"_n, const_mem_fun<commit, checksum256, &commit::by_commit_hash>>,
52 indexed_by<
"byprojhash"_n, const_mem_fun<commit, checksum256, &commit::by_project_hash>>
63 inline std::optional<commit>
get_commit(eosio::name coopname,
const checksum256 &hash) {
85 eosio::check(
commit.has_value(),
"Коммит не найден");
95inline void delete_commit(eosio::name coopname,
const checksum256 &hash) {
100 eosio::check(itr !=
commit_index.end(),
"Коммит не найден");
114 eosio::name coopname,
115 eosio::name username,
116 checksum256 project_hash,
117 checksum256 commit_hash,
118 std::string description,
127 commits.emplace(coopname, [&](
auto &c) {
130 c.coopname = coopname;
131 c.username = username;
132 c.project_hash = project_hash;
133 c.commit_hash = commit_hash;
134 c.description = description;
136 c.amounts = calculated_fact;
137 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
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:53
void delete_commit(eosio::name coopname, const checksum256 &hash)
Удаляет коммит по хэшу действия.
Definition: commits.hpp:95
void create_commit(eosio::name coopname, eosio::name username, checksum256 project_hash, checksum256 commit_hash, std::string description, std::string meta, const generation_amounts &calculated_fact)
Создает коммит без отправки на утверждение.
Definition: commits.hpp:113
commit get_commit_or_fail(eosio::name coopname, const checksum256 &hash)
Получает действие по хэшу действия.
Definition: commits.hpp:83
std::optional< commit > get_commit(eosio::name coopname, const checksum256 &hash)
Получает действие по хэшу действия.
Definition: commits.hpp:63
Definition: eosio.msig.hpp:34
Таблица коммитов хранит данные о выполненных операциях в проекте.
Definition: commits.hpp:30
checksum256 by_commit_hash() const
Индекс по хэшу коммита (3)
Definition: commits.hpp:44
checksum256 project_hash
Хэш проекта, связанного с действием
Definition: commits.hpp:35
time_point_sec created_at
Дата и время создания действия
Definition: commits.hpp:40
checksum256 commit_hash
Хэш действия
Definition: commits.hpp:36
generation_amounts amounts
Рассчитанные показатели генерации
Definition: commits.hpp:39
uint64_t primary_key() const
Первичный ключ (1)
Definition: commits.hpp:42
name username
Имя пользователя, совершившего действие
Definition: commits.hpp:33
std::string meta
Метаданные коммита
Definition: commits.hpp:38
uint64_t by_username() const
Индекс по имени пользователя (2)
Definition: commits.hpp:43
uint64_t id
ID коммита (внутренний ключ)
Definition: commits.hpp:31
name coopname
Имя кооператива
Definition: commits.hpp:32
checksum256 by_project_hash() const
Индекс по хэшу проекта (4)
Definition: commits.hpp:45
std::string description
Описание действия
Definition: commits.hpp:37
name status
Статус коммита (created | approved | authorized | act1 | act2)
Definition: commits.hpp:34
Структура для результатов расчета генерации коммита Содержит только те поля, которые рассчитываются п...
Definition: generation_amounts.hpp:14