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