BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
chain_parameters.cpp
Go to the documentation of this file.
3 
4 #include <fc/io/raw.hpp>
5 
6 namespace graphene { namespace protocol {
8  current_fees = std::make_shared<fee_schedule>();
9  }
10 
11  // copy constructor
13  {
14  current_fees = std::make_shared<fee_schedule>(*other.current_fees);
15  safe_copy(*this, other);
16  }
17 
18  // copy assignment
20  {
21  if (&other != this)
22  {
23  current_fees = std::make_shared<fee_schedule>(*other.current_fees);
24  safe_copy(*this, other);
25  }
26  return *this;
27  }
28 
29  // copies the easy stuff
30  void chain_parameters::safe_copy(chain_parameters& to, const chain_parameters& from)
31  {
60  to.extensions = from.extensions;
61  }
62 
63  // move constructor
65  {
66  current_fees = std::move(other.current_fees);
67  safe_copy(*this, other);
68  }
69 
70  // move assignment
72  {
73  if (&other != this)
74  {
75  current_fees = std::move(other.current_fees);
76  safe_copy(*this, other);
77  }
78  return *this;
79  }
80 
82  {
88 
93  "Maintenance interval must be longer than block interval" );
95  "Maintenance interval must be a multiple of block interval" );
97  "Transaction size limit is too low" );
99  "Block size limit is too low" );
101  "Maximum transaction expiration time must be greater than a block interval" );
103  "Committee proposal review period must be less than the maximum proposal lifetime" );
104  if( extensions.value.market_fee_network_percent.valid() )
105  {
106  FC_ASSERT( *extensions.value.market_fee_network_percent <= 3000, // GRAPHENE_100_PERCENT is 10000
107  "The market_fee_network_percent parameter can not exceed 30%" );
108  }
109  if( extensions.value.maker_fee_discount_percent.valid() )
110  {
111  FC_ASSERT( *extensions.value.maker_fee_discount_percent <= GRAPHENE_100_PERCENT,
112  "The maker_fee_discount_percent parameter can not exceed 100%" );
113  }
114  }
115 
117  {
118  return extensions.value.market_fee_network_percent.valid() ?
119  *extensions.value.market_fee_network_percent : 0;
120  }
121 
123  {
124  return extensions.value.maker_fee_discount_percent.valid() ?
125  *extensions.value.maker_fee_discount_percent : 0;
126  }
127 
128 }}
129 
graphene::protocol::chain_parameters::maximum_proposal_lifetime
uint32_t maximum_proposal_lifetime
maximum lifetime in seconds for proposed transactions to be kept, before expiring
Definition: chain_parameters.hpp:60
GRAPHENE_MIN_BLOCK_INTERVAL
#define GRAPHENE_MIN_BLOCK_INTERVAL
Definition: config.hpp:59
graphene::protocol::chain_parameters::lifetime_referrer_percent_of_fee
uint16_t lifetime_referrer_percent_of_fee
percent of fee which should go to lifetime referrer
Definition: chain_parameters.hpp:68
GRAPHENE_MAX_BLOCK_INTERVAL
#define GRAPHENE_MAX_BLOCK_INTERVAL
Definition: config.hpp:60
fee_schedule.hpp
graphene::protocol::fee_schedule::validate
void validate() const
Definition: fee_schedule.hpp:198
graphene::protocol::chain_parameters::maintenance_skip_slots
uint8_t maintenance_skip_slots
number of block_intervals to skip at maintenance time
Definition: chain_parameters.hpp:55
graphene::protocol::chain_parameters::get_maker_fee_discount_percent
uint16_t get_maker_fee_discount_percent() const
Definition: chain_parameters.cpp:122
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
#define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:86
graphene::protocol::chain_parameters::witness_pay_vesting_seconds
uint32_t witness_pay_vesting_seconds
vesting_seconds parameter for witness VBO's
Definition: chain_parameters.hpp:74
graphene::protocol::chain_parameters::get_current_fees
const fee_schedule & get_current_fees() const
Definition: chain_parameters.hpp:50
graphene::protocol::chain_parameters::chain_parameters
chain_parameters()
Definition: chain_parameters.cpp:7
graphene::protocol::chain_parameters::maximum_transaction_size
uint32_t maximum_transaction_size
maximum allowable size in bytes for a transaction
Definition: chain_parameters.hpp:57
graphene::protocol::chain_parameters::cashback_vesting_period_seconds
uint32_t cashback_vesting_period_seconds
time after cashback rewards are accrued before they become liquid
Definition: chain_parameters.hpp:69
graphene::protocol::chain_parameters::allow_non_member_whitelists
bool allow_non_member_whitelists
true if non-member accounts may set whitelists and blacklists; false otherwise
Definition: chain_parameters.hpp:72
graphene::protocol::chain_parameters::network_percent_of_fee
uint16_t network_percent_of_fee
percent of transaction fees paid to network
Definition: chain_parameters.hpp:67
graphene::protocol::chain_parameters::account_fee_scale_bitshifts
uint8_t account_fee_scale_bitshifts
number of times to left bitshift account registration fee at each scaling
Definition: chain_parameters.hpp:79
graphene::protocol::chain_parameters::extensions
extension< ext > extensions
Definition: chain_parameters.hpp:90
graphene::protocol::chain_parameters::accounts_per_fee_scale
uint16_t accounts_per_fee_scale
number of accounts between fee scalings
Definition: chain_parameters.hpp:78
graphene::protocol::chain_parameters::validate
void validate() const
Definition: chain_parameters.cpp:81
graphene::protocol::chain_parameters::maximum_committee_count
uint16_t maximum_committee_count
maximum number of active committee_members
Definition: chain_parameters.hpp:64
graphene::protocol::chain_parameters::get_market_fee_network_percent
uint16_t get_market_fee_network_percent() const
Definition: chain_parameters.cpp:116
graphene::protocol::chain_parameters::witness_pay_per_block
share_type witness_pay_per_block
CORE to be allocated to witnesses (per block)
Definition: chain_parameters.hpp:73
graphene::protocol::chain_parameters
Definition: chain_parameters.hpp:46
graphene::protocol::chain_parameters::max_authority_depth
uint8_t max_authority_depth
Definition: chain_parameters.hpp:80
graphene::protocol::chain_parameters::committee_proposal_review_period
uint32_t committee_proposal_review_period
minimum time in seconds that a proposed transaction requiring committee authority may not be signed,...
Definition: chain_parameters.hpp:56
graphene::protocol::chain_parameters::maximum_witness_count
uint16_t maximum_witness_count
maximum number of active witnesses
Definition: chain_parameters.hpp:63
graphene::protocol::chain_parameters::maximum_asset_whitelist_authorities
uint8_t maximum_asset_whitelist_authorities
maximum number of accounts which an asset may list as authorities for its whitelist OR blacklist
Definition: chain_parameters.hpp:61
graphene::protocol::chain_parameters::fee_liquidation_threshold
share_type fee_liquidation_threshold
value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated
Definition: chain_parameters.hpp:77
GRAPHENE_MIN_BLOCK_SIZE_LIMIT
#define GRAPHENE_MIN_BLOCK_SIZE_LIMIT
Definition: config.hpp:99
graphene::protocol::chain_parameters::cashback_vesting_threshold
share_type cashback_vesting_threshold
the maximum cashback that can be received without vesting
Definition: chain_parameters.hpp:70
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
graphene::protocol::chain_parameters::count_non_member_votes
bool count_non_member_votes
set to false to restrict voting privlegages to member accounts
Definition: chain_parameters.hpp:71
graphene::protocol::chain_parameters::operator=
chain_parameters & operator=(const chain_parameters &other)
Definition: chain_parameters.cpp:19
graphene::protocol::chain_parameters::current_fees
std::shared_ptr< const fee_schedule > current_fees
current schedule of fees
Definition: chain_parameters.hpp:49
graphene::protocol::chain_parameters::reserve_percent_of_fee
uint16_t reserve_percent_of_fee
the percentage of the network's allocation of a fee that is taken out of circulation
Definition: chain_parameters.hpp:66
graphene::protocol::chain_parameters::maintenance_interval
uint32_t maintenance_interval
interval in sections between blockchain maintenance events
Definition: chain_parameters.hpp:54
graphene::protocol::chain_parameters::max_predicate_opcode
uint16_t max_predicate_opcode
predicate_opcode must be less than this number
Definition: chain_parameters.hpp:76
graphene::protocol::chain_parameters::maximum_block_size
uint32_t maximum_block_size
maximum allowable size in bytes for a block
Definition: chain_parameters.hpp:58
GRAPHENE_MIN_TRANSACTION_SIZE_LIMIT
#define GRAPHENE_MIN_TRANSACTION_SIZE_LIMIT
Definition: config.hpp:58
graphene::protocol::chain_parameters::maximum_asset_feed_publishers
uint8_t maximum_asset_feed_publishers
the maximum number of feed publishers for a given asset
Definition: chain_parameters.hpp:62
graphene::protocol::chain_parameters::worker_budget_per_day
share_type worker_budget_per_day
CORE to be allocated to workers (per day)
Definition: chain_parameters.hpp:75
chain_parameters.hpp
GRAPHENE_100_PERCENT
#define GRAPHENE_100_PERCENT
Definition: config.hpp:102
graphene
Definition: api.cpp:48
graphene::protocol::chain_parameters::maximum_authority_membership
uint16_t maximum_authority_membership
largest number of keys/accounts an authority can have
Definition: chain_parameters.hpp:65
graphene::protocol::chain_parameters::maximum_time_until_expiration
uint32_t maximum_time_until_expiration
maximum lifetime in seconds for transactions to be valid, before expiring
Definition: chain_parameters.hpp:59
graphene::protocol::chain_parameters::block_interval
uint8_t block_interval
interval in seconds between blocks
Definition: chain_parameters.hpp:53
raw.hpp