Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysiosystem::producer_info Struct Reference

#include <sysio.system.hpp>

Collaboration diagram for sysiosystem::producer_info:

Public Member Functions

uint64_t primary_key () const
 
double by_votes () const
 
bool active () const
 
void deactivate ()
 
sysio::block_signing_authority get_producer_authority () const
 

Public Attributes

name owner
 
double total_votes = 0
 
sysio::public_key producer_key
 
bool is_active = true
 a packed public key object
 
std::string url
 
uint32_t unpaid_blocks = 0
 
time_point last_claim_time
 
uint16_t location = 0
 
sysio::binary_extension< sysio::block_signing_authorityproducer_authority
 

Friends

template<typename DataStream >
DataStream & operator<< (DataStream &ds, const producer_info &t)
 
template<typename DataStream >
DataStream & operator>> (DataStream &ds, producer_info &t)
 

Detailed Description

Definition at line 205 of file sysio.system.hpp.

Member Function Documentation

◆ active()

bool sysiosystem::producer_info::active ( ) const
inline

Definition at line 218 of file sysio.system.hpp.

218{ return is_active; }
bool is_active
a packed public key object

◆ by_votes()

double sysiosystem::producer_info::by_votes ( ) const
inline

Definition at line 217 of file sysio.system.hpp.

◆ deactivate()

void sysiosystem::producer_info::deactivate ( )
inline

Definition at line 219 of file sysio.system.hpp.

219{ producer_key = public_key(); producer_authority.reset(); is_active = false; }
sysio::binary_extension< sysio::block_signing_authority > producer_authority
sysio::public_key producer_key

◆ get_producer_authority()

sysio::block_signing_authority sysiosystem::producer_info::get_producer_authority ( ) const
inline

Definition at line 221 of file sysio.system.hpp.

221 {
222 if( producer_authority.has_value() ) {
223 bool zero_threshold = std::visit( [](auto&& auth ) -> bool {
224 return (auth.threshold == 0);
225 }, *producer_authority );
226 // zero_threshold could be true despite the validation done in regproducer2 because the v1.9.0 sysio.system
227 // contract has a bug which may have modified the producer table such that the producer_authority field
228 // contains a default constructed sysio::block_signing_authority (which has a 0 threshold and so is invalid).
229 if( !zero_threshold ) return *producer_authority;
230 }
232 }
sysio::block_signing_authority convert_to_block_signing_authority(const sysio::public_key &producer_key)
Here is the call graph for this function:

◆ primary_key()

uint64_t sysiosystem::producer_info::primary_key ( ) const
inline

Definition at line 216 of file sysio.system.hpp.

216{ return owner.value; }

Friends And Related Symbol Documentation

◆ operator<<

template<typename DataStream >
DataStream & operator<< ( DataStream & ds,
const producer_info & t )
friend

Definition at line 244 of file sysio.system.hpp.

244 {
245 ds << t.owner
246 << t.total_votes
247 << t.producer_key
248 << t.is_active
249 << t.url
250 << t.unpaid_blocks
251 << t.last_claim_time
252 << t.location;
253
254 if( !t.producer_authority.has_value() ) return ds;
255
256 return ds << t.producer_authority;
257 }
static const Segment ds(Segment::ds)

◆ operator>>

template<typename DataStream >
DataStream & operator>> ( DataStream & ds,
producer_info & t )
friend

Definition at line 260 of file sysio.system.hpp.

260 {
261 return ds >> t.owner
262 >> t.total_votes
263 >> t.producer_key
264 >> t.is_active
265 >> t.url
266 >> t.unpaid_blocks
267 >> t.last_claim_time
268 >> t.location
269 >> t.producer_authority;
270 }

Member Data Documentation

◆ is_active

bool sysiosystem::producer_info::is_active = true

Definition at line 209 of file sysio.system.hpp.

◆ last_claim_time

time_point sysiosystem::producer_info::last_claim_time

Definition at line 212 of file sysio.system.hpp.

◆ location

uint16_t sysiosystem::producer_info::location = 0

Definition at line 213 of file sysio.system.hpp.

◆ owner

name sysiosystem::producer_info::owner

Definition at line 206 of file sysio.system.hpp.

◆ producer_authority

sysio::binary_extension<sysio::block_signing_authority> sysiosystem::producer_info::producer_authority

Definition at line 214 of file sysio.system.hpp.

◆ producer_key

sysio::public_key sysiosystem::producer_info::producer_key

Definition at line 208 of file sysio.system.hpp.

◆ total_votes

double sysiosystem::producer_info::total_votes = 0

Definition at line 207 of file sysio.system.hpp.

◆ unpaid_blocks

uint32_t sysiosystem::producer_info::unpaid_blocks = 0

Definition at line 211 of file sysio.system.hpp.

◆ url

std::string sysiosystem::producer_info::url

Definition at line 210 of file sysio.system.hpp.


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