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

#include <resource_limits.hpp>

Collaboration diagram for sysio::chain::resource_limits::elastic_limit_parameters:

Public Member Functions

void validate () const
 

Public Attributes

uint64_t target
 
uint64_t max
 
uint32_t periods
 
uint32_t max_multiplier
 
ratio contract_rate
 
ratio expand_rate
 

Friends

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

Detailed Description

Definition at line 34 of file resource_limits.hpp.

Member Function Documentation

◆ validate()

void sysio::chain::resource_limits::elastic_limit_parameters::validate ( ) const

Definition at line 32 of file resource_limits.cpp.

32 {
33 // At the very least ensure parameters are not set to values that will cause divide by zero errors later on.
34 // Stricter checks for sensible values can be added later.
35 SYS_ASSERT( periods > 0, resource_limit_exception, "elastic limit parameter 'periods' cannot be zero" );
36 SYS_ASSERT( contract_rate.denominator > 0, resource_limit_exception, "elastic limit parameter 'contract_rate' is not a well-defined ratio" );
37 SYS_ASSERT( expand_rate.denominator > 0, resource_limit_exception, "elastic limit parameter 'expand_rate' is not a well-defined ratio" );
38}
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 50 of file resource_limits.hpp.

50 {
51 return !(lhs == rhs);
52 }

◆ operator==

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

Definition at line 45 of file resource_limits.hpp.

45 {
46 return std::tie(lhs.target, lhs.max, lhs.periods, lhs.max_multiplier, lhs.contract_rate, lhs.expand_rate)
47 == std::tie(rhs.target, rhs.max, rhs.periods, rhs.max_multiplier, rhs.contract_rate, rhs.expand_rate);
48 }

Member Data Documentation

◆ contract_rate

ratio sysio::chain::resource_limits::elastic_limit_parameters::contract_rate

Definition at line 40 of file resource_limits.hpp.

◆ expand_rate

ratio sysio::chain::resource_limits::elastic_limit_parameters::expand_rate

Definition at line 41 of file resource_limits.hpp.

◆ max

uint64_t sysio::chain::resource_limits::elastic_limit_parameters::max

Definition at line 36 of file resource_limits.hpp.

◆ max_multiplier

uint32_t sysio::chain::resource_limits::elastic_limit_parameters::max_multiplier

Definition at line 39 of file resource_limits.hpp.

◆ periods

uint32_t sysio::chain::resource_limits::elastic_limit_parameters::periods

Definition at line 37 of file resource_limits.hpp.

◆ target

uint64_t sysio::chain::resource_limits::elastic_limit_parameters::target

Definition at line 35 of file resource_limits.hpp.


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