4#include "../core/ram_payer.hpp"
5#include <eosio/asset.hpp>
6#include <eosio/crypto.hpp>
7#include <eosio/eosio.hpp>
11#include "../consts.hpp"
33 eosio::time_point_sec created_at = current_time_point();
37 checksum256
by_hash()
const {
return outcome_hash; }
41typedef eosio::multi_index<
42 "outcomes"_n, outcome,
43 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<outcome, checksum256, &outcome::by_hash>>,
44 eosio::indexed_by<
"byusername"_n, eosio::const_mem_fun<outcome, uint64_t, &outcome::by_username>>,
45 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<outcome, uint64_t, &outcome::by_status>>>
48inline std::optional<outcome>
get_outcome(eosio::name coopname,
const checksum256 &hash) {
50 auto secondary_index = primary_index.get_index<
"byhash"_n>();
52 auto itr = secondary_index.find(hash);
53 if (itr == secondary_index.end()) {
static constexpr eosio::name _gateway
Definition: consts.hpp:173
contract
Definition: eosio.msig_tests.cpp:977
Definition: gateway.hpp:20
std::optional< outcome > get_outcome(eosio::name coopname, const checksum256 &hash)
Definition: table_gateway_outcomes.hpp:48
eosio::multi_index< "outcomes"_n, outcome, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< outcome, checksum256, &outcome::by_hash > >, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< outcome, uint64_t, &outcome::by_username > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< outcome, uint64_t, &outcome::by_status > > > outcomes_index
Definition: table_gateway_outcomes.hpp:46
Definition: eosio.msig.hpp:34
Definition: table_gateway_outcomes.hpp:20
checksum256 outcome_hash
Definition: table_gateway_outcomes.hpp:25
eosio::name status
Definition: table_gateway_outcomes.hpp:31
eosio::name type
Definition: table_gateway_outcomes.hpp:24
eosio::name callback_contract
Definition: table_gateway_outcomes.hpp:26
eosio::name username
Definition: table_gateway_outcomes.hpp:23
uint64_t id
Definition: table_gateway_outcomes.hpp:21
eosio::name coopname
Definition: table_gateway_outcomes.hpp:22
eosio::name confirm_callback
Definition: table_gateway_outcomes.hpp:27
uint64_t primary_key() const
Definition: table_gateway_outcomes.hpp:35
eosio::asset quantity
Definition: table_gateway_outcomes.hpp:30
eosio::name decline_callback
Definition: table_gateway_outcomes.hpp:28
uint64_t by_status() const
Definition: table_gateway_outcomes.hpp:38
uint64_t by_username() const
Definition: table_gateway_outcomes.hpp:36
checksum256 by_hash() const
Definition: table_gateway_outcomes.hpp:37
Definition: table_registrator_orgs.hpp:17
RAM_PAYER_CLASS(Gateway::outcome, cooperative)