COOPENOMICS  v1
Кооперативная Экономика
table_ano_endorsements.hpp
См. документацию.
1#pragma once
2
3
4#include "../core/ram_payer.hpp"
5#include <eosio/crypto.hpp>
6#include <eosio/eosio.hpp>
7#include <eosio/time.hpp>
8#include <string>
9
10#include "../consts.hpp"
11
12namespace Ano {
13
14using namespace eosio;
15
55struct [[eosio::table, eosio::contract(ANO)]] endorsement {
56 name subject;
57 name issuer;
58 checksum256 chain_id;
59 public_key cert_key;
60 time_point_sec issued_at;
61 time_point_sec expires_at;
62 std::string credential;
63
64 uint64_t primary_key() const { return subject.value; }
65 uint64_t by_issuer() const { return issuer.value; }
66 uint64_t by_expires() const { return static_cast<uint64_t>(expires_at.sec_since_epoch()); }
67};
68
74typedef eosio::multi_index<
75 "endorsements"_n, endorsement,
76 eosio::indexed_by<"byissuer"_n, eosio::const_mem_fun<endorsement, uint64_t, &endorsement::by_issuer>>,
77 eosio::indexed_by<"byexpires"_n, eosio::const_mem_fun<endorsement, uint64_t, &endorsement::by_expires>>>
79
80} // namespace Ano
81
82// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
contract
Definition: eosio.msig_tests.cpp:977
Definition: ano.hpp:67
eosio::multi_index< "endorsements"_n, endorsement, eosio::indexed_by<"byissuer"_n, eosio::const_mem_fun< endorsement, uint64_t, &endorsement::by_issuer > >, eosio::indexed_by<"byexpires"_n, eosio::const_mem_fun< endorsement, uint64_t, &endorsement::by_expires > > > endorsements_index
Definition: table_ano_endorsements.hpp:78
Definition: eosio.msig.hpp:34
Заверение: подтверждение того, что заверяющий признаёт ключ заверения того, кого он заверяет.
Definition: table_ano_endorsements.hpp:55
name issuer
кто заверяет
Definition: table_ano_endorsements.hpp:57
uint64_t primary_key() const
Definition: table_ano_endorsements.hpp:64
uint64_t by_issuer() const
Definition: table_ano_endorsements.hpp:65
checksum256 chain_id
сеть, в которой действует заверение
Definition: table_ano_endorsements.hpp:58
name subject
кого заверяют — первичный ключ
Definition: table_ano_endorsements.hpp:56
std::string credential
подписанное заверение целиком, для проверки без сети
Definition: table_ano_endorsements.hpp:62
time_point_sec issued_at
когда выдано
Definition: table_ano_endorsements.hpp:60
public_key cert_key
ключ заверения субъекта, который признаётся
Definition: table_ano_endorsements.hpp:59
time_point_sec expires_at
когда перестаёт действовать
Definition: table_ano_endorsements.hpp:61
uint64_t by_expires() const
Definition: table_ano_endorsements.hpp:66
RAM_PAYER_CLASS(Ano::endorsement, contract)