4#include "../core/ram_payer.hpp"
6#include <eosio/binary_extension.hpp>
7#include <eosio/eosio.hpp>
10#include "../consts.hpp"
26 eosio::binary_extension<std::vector<eosio::name>>
whitelist;
34 auto itr = std::remove(trusted.begin(), trusted.end(),
account);
35 eosio::check(itr != trusted.end(),
"Account not found in trusted list");
36 trusted.erase(itr, trusted.end());
40 return std::find(trusted.begin(), trusted.end(),
account) != trusted.end();
44 if (trustee == username) {
55 if (!whitelist.has_value()) {
58 const auto &wl = whitelist.value();
59 return std::find(wl.begin(), wl.end(),
account) != wl.end();
65 if (!whitelist.has_value()) {
68 auto &wl = whitelist.value();
69 eosio::check(std::find(wl.begin(), wl.end(),
account) == wl.end(),
70 "Аккаунт уже добавлен в белый список кооперативного участка");
75 eosio::check(whitelist.has_value(),
"Белый список кооперативного участка пуст");
76 auto &wl = whitelist.value();
77 auto it = std::find(wl.begin(), wl.end(),
account);
78 eosio::check(it != wl.end(),
"Аккаунт не найден в белом списке кооперативного участка");
83typedef eosio::multi_index<
85 eosio::indexed_by<
"bytrustee"_n, eosio::const_mem_fun<coobranch, uint64_t, &coobranch::by_trustee>>>
90 auto branch = branches.find(braname.value);
92 eosio::check(
branch != branches.end(),
"Кооперативный Участок не найден");
Константы контракта кооперативных участков
Definition: branch.hpp:55
static constexpr eosio::name _branch
Definition: consts.hpp:181
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_registrator_accounts.hpp:16
Definition: table_branch_branches.hpp:17
void set_private(bool value)
Definition: table_branch_branches.hpp:62
eosio::binary_extension< bool > is_private
Definition: table_branch_branches.hpp:25
uint64_t by_trustee() const
Definition: table_branch_branches.hpp:29
void remove_account_from_whitelist(const eosio::name &account)
Definition: table_branch_branches.hpp:74
void add_account_to_trusted(const eosio::name &account)
Definition: table_branch_branches.hpp:31
bool is_branch_private() const
Definition: table_branch_branches.hpp:52
void add_account_to_whitelist(const eosio::name &account)
Definition: table_branch_branches.hpp:64
uint64_t primary_key() const
Definition: table_branch_branches.hpp:28
void remove_account_from_trusted(const eosio::name &account)
Definition: table_branch_branches.hpp:33
bool is_user_authorized(const eosio::name &username) const
Definition: table_branch_branches.hpp:43
bool is_account_in_trusted(const eosio::name &account) const
Definition: table_branch_branches.hpp:39
eosio::binary_extension< std::vector< eosio::name > > whitelist
Definition: table_branch_branches.hpp:26
eosio::name trustee
Definition: table_branch_branches.hpp:19
std::vector< eosio::name > trusted
Definition: table_branch_branches.hpp:20
bool is_account_in_whitelist(const eosio::name &account) const
Definition: table_branch_branches.hpp:54
eosio::name braname
Definition: table_branch_branches.hpp:18
coobranch get_branch_or_fail(eosio::name coopname, eosio::name braname)
Definition: table_branch_branches.hpp:88
eosio::multi_index< "branches"_n, coobranch, eosio::indexed_by<"bytrustee"_n, eosio::const_mem_fun< coobranch, uint64_t, &coobranch::by_trustee > > > branch_index
Definition: table_branch_branches.hpp:86
RAM_PAYER_CLASS(coobranch, contract)