Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::producer_authority Struct Reference

#include <producer_schedule.hpp>

Collaboration diagram for sysio::chain::producer_authority:

Public Member Functions

template<typename Op >
void for_each_key (Op &&op) const
 
std::pair< bool, size_t > keys_satisfy_and_relevant (const std::set< public_key_type > &presented_keys) const
 
auto to_shared (chainbase::allocator< char > alloc) const
 
fc::variant get_abi_variant () const
 

Static Public Member Functions

template<typename Op >
static void for_each_key (const block_signing_authority &authority, Op &&op)
 
static std::pair< bool, size_t > keys_satisfy_and_relevant (const std::set< public_key_type > &keys, const block_signing_authority &authority)
 
static auto from_shared (const shared_producer_authority &src)
 

Public Attributes

name producer_name
 
block_signing_authority authority
 

Friends

bool operator== (const producer_authority &lhs, const producer_authority &rhs)
 
bool operator!= (const producer_authority &lhs, const producer_authority &rhs)
 

Detailed Description

Definition at line 163 of file producer_schedule.hpp.

Member Function Documentation

◆ for_each_key() [1/2]

template<typename Op >
static void sysio::chain::producer_authority::for_each_key ( const block_signing_authority & authority,
Op && op )
inlinestatic

Definition at line 168 of file producer_schedule.hpp.

168 {
169 std::visit([&op](const auto &a){
170 a.for_each_key(std::forward<Op>(op));
171 }, authority);
172 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
Here is the caller graph for this function:

◆ for_each_key() [2/2]

template<typename Op >
void sysio::chain::producer_authority::for_each_key ( Op && op) const
inline

Definition at line 175 of file producer_schedule.hpp.

175 {
176 for_each_key(authority, std::forward<Op>(op));
177 }
static void for_each_key(const block_signing_authority &authority, Op &&op)
Here is the call graph for this function:

◆ from_shared()

static auto sysio::chain::producer_authority::from_shared ( const shared_producer_authority & src)
inlinestatic

Definition at line 197 of file producer_schedule.hpp.

197 {
198 producer_authority result;
199 result.producer_name = src.producer_name;
200 result.authority = std::visit(overloaded {
201 [](const shared_block_signing_authority_v0& a) {
203 }
204 }, src.authority);
205
206 return result;
207 }
overloaded(Ts...) -> overloaded< Ts... >
static auto from_shared(const shared_block_signing_authority_v0 &src)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_abi_variant()

fc::variant sysio::chain::producer_authority::get_abi_variant ( ) const

ABI's for contracts expect variants to be serialized as a 2 entry array of [type-name, value].

This is incompatible with standard FC rules for static_variants which produce

[ordinal, value]

this method produces an appropriate variant for contracts where the authority field is correctly formatted

Definition at line 5 of file producer_schedule.cpp.

5 {
6 auto authority_variant = std::visit([](const auto& a){
9
10 fc::variant type = std::string(std::decay_t<decltype(a)>::abi_type_name());
11
12 return fc::variants {
13 std::move(type),
14 std::move(value)
15 };
16 }, authority);
17
19 ("producer_name", producer_name)
20 ("authority", std::move(authority_variant));
21}
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
std::vector< fc::variant > variants
Definition variant.hpp:173
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
Definition authority.cpp:4
#define value
Definition pkcs11.h:157
Here is the call graph for this function:

◆ keys_satisfy_and_relevant() [1/2]

static std::pair< bool, size_t > sysio::chain::producer_authority::keys_satisfy_and_relevant ( const std::set< public_key_type > & keys,
const block_signing_authority & authority )
inlinestatic

Definition at line 179 of file producer_schedule.hpp.

179 {
180 return std::visit([&keys](const auto &a){
181 return a.keys_satisfy_and_relevant(keys);
182 }, authority);
183 }
Here is the caller graph for this function:

◆ keys_satisfy_and_relevant() [2/2]

std::pair< bool, size_t > sysio::chain::producer_authority::keys_satisfy_and_relevant ( const std::set< public_key_type > & presented_keys) const
inline

Definition at line 185 of file producer_schedule.hpp.

185 {
186 return keys_satisfy_and_relevant(presented_keys, authority);
187 }
static std::pair< bool, size_t > keys_satisfy_and_relevant(const std::set< public_key_type > &keys, const block_signing_authority &authority)
Here is the call graph for this function:

◆ to_shared()

auto sysio::chain::producer_authority::to_shared ( chainbase::allocator< char > alloc) const
inline

Definition at line 189 of file producer_schedule.hpp.

189 {
190 auto shared_auth = std::visit([&alloc](const auto& a) {
191 return a.to_shared(alloc);
192 }, authority);
193
194 return shared_producer_authority(producer_name, std::move(shared_auth));
195 }

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const producer_authority & lhs,
const producer_authority & rhs )
friend

Definition at line 226 of file producer_schedule.hpp.

226 {
227 return tie( lhs.producer_name, lhs.authority ) != tie( rhs.producer_name, rhs.authority );
228 }

◆ operator==

bool operator== ( const producer_authority & lhs,
const producer_authority & rhs )
friend

Definition at line 223 of file producer_schedule.hpp.

223 {
224 return tie( lhs.producer_name, lhs.authority ) == tie( rhs.producer_name, rhs.authority );
225 }

Member Data Documentation

◆ authority

block_signing_authority sysio::chain::producer_authority::authority

Definition at line 165 of file producer_schedule.hpp.

◆ producer_name

name sysio::chain::producer_authority::producer_name

Definition at line 164 of file producer_schedule.hpp.


The documentation for this struct was generated from the following files: