BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
graphene::protocol::fee_schedule Struct Reference

contains all of the parameters necessary to calculate the fee for any operation More...

#include <fee_schedule.hpp>

Public Member Functions

 fee_schedule ()
 
asset calculate_fee (const operation &op) const
 
asset calculate_fee (const operation &op, const price &core_exchange_rate) const
 
asset set_fee (operation &op, const price &core_exchange_rate=price::unit_price()) const
 
void zero_all_fees ()
 
void validate () const
 
template<typename Operation >
const Operation::fee_parameters_type & get () const
 
template<typename Operation >
Operation::fee_parameters_type & get ()
 
template<typename Operation >
bool exists () const
 

Static Public Member Functions

static fee_schedule get_default ()
 

Public Attributes

fee_parameters::flat_set_type parameters
 
uint32_t scale = GRAPHENE_100_PERCENT
 fee * scale / GRAPHENE_100_PERCENT More...
 

Detailed Description

contains all of the parameters necessary to calculate the fee for any operation

Definition at line 173 of file fee_schedule.hpp.

Constructor & Destructor Documentation

graphene::protocol::fee_schedule::fee_schedule ( )

Definition at line 33 of file fee_schedule.cpp.

Member Function Documentation

asset graphene::protocol::fee_schedule::calculate_fee ( const operation op) const

Finds the appropriate fee parameter struct for the operation and then calculates the appropriate fee in CORE asset.

Definition at line 79 of file fee_schedule_calc.cpp.

asset graphene::protocol::fee_schedule::calculate_fee ( const operation op,
const price core_exchange_rate 
) const

Finds the appropriate fee parameter struct for the operation and then calculates the appropriate fee in an asset specified implicitly by core_exchange_rate.

Definition at line 93 of file fee_schedule_calc.cpp.

template<typename Operation >
bool graphene::protocol::fee_schedule::exists ( ) const
inline

Definition at line 213 of file fee_schedule.hpp.

template<typename Operation >
const Operation::fee_parameters_type& graphene::protocol::fee_schedule::get ( ) const
inline

Definition at line 203 of file fee_schedule.hpp.

template<typename Operation >
Operation::fee_parameters_type& graphene::protocol::fee_schedule::get ( )
inline

Definition at line 208 of file fee_schedule.hpp.

fee_schedule graphene::protocol::fee_schedule::get_default ( )
static

Definition at line 37 of file fee_schedule.cpp.

asset graphene::protocol::fee_schedule::set_fee ( operation op,
const price core_exchange_rate = price::unit_price() 
) const

Updates the operation with appropriate fee and returns the fee.

Definition at line 81 of file fee_schedule.cpp.

void graphene::protocol::fee_schedule::validate ( ) const
inline

Validates all of the parameters are present and accounted for.

Definition at line 200 of file fee_schedule.hpp.

void graphene::protocol::fee_schedule::zero_all_fees ( )

Definition at line 73 of file fee_schedule.cpp.

Member Data Documentation

fee_parameters::flat_set_type graphene::protocol::fee_schedule::parameters
Note
must be sorted by fee_parameters.which() and have no duplicates

Definition at line 222 of file fee_schedule.hpp.

uint32_t graphene::protocol::fee_schedule::scale = GRAPHENE_100_PERCENT

fee * scale / GRAPHENE_100_PERCENT

Definition at line 223 of file fee_schedule.hpp.


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