4#include <eosio/binary_extension.hpp>
5#include <eosio/eosio.hpp>
8#include "../consts.hpp"
24 eosio::binary_extension<std::vector<eosio::name>>
whitelist;
32 auto itr = std::remove(trusted.begin(), trusted.end(),
account);
33 eosio::check(itr != trusted.end(),
"Account not found in trusted list");
34 trusted.erase(itr, trusted.end());
38 return std::find(trusted.begin(), trusted.end(),
account) != trusted.end();
42 if (trustee == username) {
53 if (!whitelist.has_value()) {
56 const auto &wl = whitelist.value();
57 return std::find(wl.begin(), wl.end(),
account) != wl.end();
63 if (!whitelist.has_value()) {
66 auto &wl = whitelist.value();
67 eosio::check(std::find(wl.begin(), wl.end(),
account) == wl.end(),
68 "Аккаунт уже добавлен в белый список кооперативного участка");
73 eosio::check(whitelist.has_value(),
"Белый список кооперативного участка пуст");
74 auto &wl = whitelist.value();
75 auto it = std::find(wl.begin(), wl.end(),
account);
76 eosio::check(it != wl.end(),
"Аккаунт не найден в белом списке кооперативного участка");
81typedef eosio::multi_index<
83 eosio::indexed_by<
"bytrustee"_n, eosio::const_mem_fun<coobranch, uint64_t, &coobranch::by_trustee>>>
88 auto branch = branches.find(braname.value);
90 eosio::check(
branch != branches.end(),
"Кооперативный Участок не найден");
Константы контракта кооперативных участков
Definition: branch.hpp:55
static constexpr eosio::name _branch
Definition: consts.hpp:176
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_registrator_accounts.hpp:14
Definition: table_branch_branches.hpp:15
void set_private(bool value)
Definition: table_branch_branches.hpp:60
eosio::binary_extension< bool > is_private
Definition: table_branch_branches.hpp:23
uint64_t by_trustee() const
Definition: table_branch_branches.hpp:27
void remove_account_from_whitelist(const eosio::name &account)
Definition: table_branch_branches.hpp:72
void add_account_to_trusted(const eosio::name &account)
Definition: table_branch_branches.hpp:29
bool is_branch_private() const
Definition: table_branch_branches.hpp:50
void add_account_to_whitelist(const eosio::name &account)
Definition: table_branch_branches.hpp:62
uint64_t primary_key() const
Definition: table_branch_branches.hpp:26
void remove_account_from_trusted(const eosio::name &account)
Definition: table_branch_branches.hpp:31
bool is_user_authorized(const eosio::name &username) const
Definition: table_branch_branches.hpp:41
bool is_account_in_trusted(const eosio::name &account) const
Definition: table_branch_branches.hpp:37
eosio::binary_extension< std::vector< eosio::name > > whitelist
Definition: table_branch_branches.hpp:24
eosio::name trustee
Definition: table_branch_branches.hpp:17
std::vector< eosio::name > trusted
Definition: table_branch_branches.hpp:18
bool is_account_in_whitelist(const eosio::name &account) const
Definition: table_branch_branches.hpp:52
eosio::name braname
Definition: table_branch_branches.hpp:16
coobranch get_branch_or_fail(eosio::name coopname, eosio::name braname)
Definition: table_branch_branches.hpp:86
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:84