BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
#include <evaluator.hpp>
Public Member Functions | |
virtual | ~generic_evaluator () |
virtual int | get_type () const =0 |
virtual operation_result | start_evaluate (transaction_evaluation_state &eval_state, const operation &op, bool apply) |
virtual operation_result | evaluate (const operation &op)=0 |
virtual operation_result | apply (const operation &op)=0 |
virtual void | pay_fee () |
database & | db () const |
Protected Member Functions | |
void | prepare_fee (account_id_type account_id, asset fee) |
Fetch objects relevant to fee payer and set pointer members. More... | |
virtual void | convert_fee () |
object_id_type | get_relative_id (object_id_type rel_id) const |
void | pay_fba_fee (uint64_t fba_id) |
share_type | calculate_fee_for_operation (const operation &op) const |
void | db_adjust_balance (const account_id_type &fee_payer, asset fee_from_account) |
Protected Attributes | |
asset | fee_from_account |
share_type | core_fee_paid |
const account_object * | fee_paying_account = nullptr |
const account_statistics_object * | fee_paying_account_statistics = nullptr |
const asset_object * | fee_asset = nullptr |
const asset_dynamic_data_object * | fee_asset_dyn_data = nullptr |
transaction_evaluation_state * | trx_state |
Definition at line 39 of file evaluator.hpp.
|
inlinevirtual |
Definition at line 42 of file evaluator.hpp.
|
pure virtual |
Implemented in graphene::chain::evaluator< DerivedEvaluator >, graphene::chain::evaluator< asset_create_evaluator >, graphene::chain::evaluator< balance_claim_evaluator >, graphene::chain::evaluator< assert_evaluator >, graphene::chain::evaluator< htlc_create_evaluator >, graphene::chain::evaluator< samet_fund_create_evaluator >, graphene::chain::evaluator< account_whitelist_evaluator >, graphene::chain::evaluator< custom_authority_create_evaluator >, graphene::chain::evaluator< account_update_evaluator >, graphene::chain::evaluator< blind_transfer_evaluator >, graphene::chain::evaluator< samet_fund_delete_evaluator >, graphene::chain::evaluator< limit_order_create_evaluator >, graphene::chain::evaluator< account_create_evaluator >, graphene::chain::evaluator< limit_order_cancel_evaluator >, graphene::chain::evaluator< custom_authority_delete_evaluator >, graphene::chain::evaluator< asset_claim_fees_evaluator >, graphene::chain::evaluator< asset_update_issuer_evaluator >, graphene::chain::evaluator< liquidity_pool_withdraw_evaluator >, graphene::chain::evaluator< asset_publish_feeds_evaluator >, graphene::chain::evaluator< withdraw_permission_create_evaluator >, graphene::chain::evaluator< credit_offer_update_evaluator >, graphene::chain::evaluator< account_upgrade_evaluator >, graphene::chain::evaluator< proposal_delete_evaluator >, graphene::chain::evaluator< htlc_redeem_evaluator >, graphene::chain::evaluator< withdraw_permission_update_evaluator >, graphene::chain::evaluator< asset_global_settle_evaluator >, graphene::chain::evaluator< asset_settle_evaluator >, graphene::chain::evaluator< override_transfer_evaluator >, graphene::chain::evaluator< vesting_balance_create_evaluator >, graphene::chain::evaluator< transfer_to_blind_evaluator >, graphene::chain::evaluator< committee_member_update_global_parameters_evaluator >, graphene::chain::evaluator< asset_fund_fee_pool_evaluator >, graphene::chain::evaluator< samet_fund_update_evaluator >, graphene::chain::evaluator< transfer_evaluator >, graphene::chain::evaluator< asset_claim_pool_evaluator >, graphene::chain::evaluator< asset_reserve_evaluator >, graphene::chain::evaluator< withdraw_permission_delete_evaluator >, graphene::chain::evaluator< ticket_create_evaluator >, graphene::chain::evaluator< ticket_update_evaluator >, graphene::chain::evaluator< worker_create_evaluator >, graphene::chain::evaluator< samet_fund_repay_evaluator >, graphene::chain::evaluator< credit_deal_repay_evaluator >, graphene::chain::evaluator< proposal_update_evaluator >, graphene::chain::evaluator< asset_update_evaluator >, graphene::chain::evaluator< credit_deal_update_evaluator >, graphene::chain::evaluator< witness_update_evaluator >, graphene::chain::evaluator< transfer_from_blind_evaluator >, graphene::chain::evaluator< vesting_balance_withdraw_evaluator >, graphene::chain::evaluator< limit_order_update_evaluator >, graphene::chain::evaluator< liquidity_pool_deposit_evaluator >, graphene::chain::evaluator< liquidity_pool_exchange_evaluator >, graphene::chain::evaluator< credit_offer_delete_evaluator >, graphene::chain::evaluator< custom_authority_update_evaluator >, graphene::chain::evaluator< samet_fund_borrow_evaluator >, graphene::chain::evaluator< htlc_extend_evaluator >, graphene::chain::evaluator< credit_offer_accept_evaluator >, graphene::chain::evaluator< custom_evaluator >, graphene::chain::evaluator< witness_create_evaluator >, graphene::chain::evaluator< credit_offer_create_evaluator >, graphene::chain::evaluator< liquidity_pool_create_evaluator >, graphene::chain::evaluator< call_order_update_evaluator >, graphene::chain::evaluator< asset_update_bitasset_evaluator >, graphene::chain::evaluator< liquidity_pool_delete_evaluator >, graphene::chain::evaluator< bid_collateral_evaluator >, graphene::chain::evaluator< withdraw_permission_claim_evaluator >, graphene::chain::evaluator< proposal_create_evaluator >, graphene::chain::evaluator< committee_member_create_evaluator >, graphene::chain::evaluator< asset_update_feed_producers_evaluator >, graphene::chain::evaluator< asset_issue_evaluator >, graphene::chain::evaluator< liquidity_pool_update_evaluator >, and graphene::chain::evaluator< committee_member_update_evaluator >.
|
protected |
Definition at line 115 of file evaluator.cpp.
|
protectedvirtual |
Convert the fee into BTS through the exchange pool.
Reads core_fee_paid field for how much CORE is deducted from the exchange pool, and fee_from_account for how much USD is added to the pool.
Since prepare_fee() does the validation checks ensuring the account and fee pool have sufficient balance and the exchange rate is correct, those validation checks are not replicated here.
Rather than returning a value, this method fills in core_fee_paid field.
Reimplemented in graphene::chain::limit_order_update_evaluator, and graphene::chain::limit_order_create_evaluator.
Definition at line 80 of file evaluator.cpp.
database & graphene::chain::generic_evaluator::db | ( | ) | const |
Definition at line 39 of file evaluator.cpp.
|
protected |
Definition at line 119 of file evaluator.cpp.
|
pure virtual |
Implemented in graphene::chain::evaluator< DerivedEvaluator >, graphene::chain::evaluator< asset_create_evaluator >, graphene::chain::evaluator< balance_claim_evaluator >, graphene::chain::evaluator< assert_evaluator >, graphene::chain::evaluator< htlc_create_evaluator >, graphene::chain::evaluator< samet_fund_create_evaluator >, graphene::chain::evaluator< account_whitelist_evaluator >, graphene::chain::evaluator< custom_authority_create_evaluator >, graphene::chain::evaluator< account_update_evaluator >, graphene::chain::evaluator< blind_transfer_evaluator >, graphene::chain::evaluator< samet_fund_delete_evaluator >, graphene::chain::evaluator< limit_order_create_evaluator >, graphene::chain::evaluator< account_create_evaluator >, graphene::chain::evaluator< limit_order_cancel_evaluator >, graphene::chain::evaluator< custom_authority_delete_evaluator >, graphene::chain::evaluator< asset_claim_fees_evaluator >, graphene::chain::evaluator< asset_update_issuer_evaluator >, graphene::chain::evaluator< liquidity_pool_withdraw_evaluator >, graphene::chain::evaluator< asset_publish_feeds_evaluator >, graphene::chain::evaluator< withdraw_permission_create_evaluator >, graphene::chain::evaluator< credit_offer_update_evaluator >, graphene::chain::evaluator< account_upgrade_evaluator >, graphene::chain::evaluator< proposal_delete_evaluator >, graphene::chain::evaluator< htlc_redeem_evaluator >, graphene::chain::evaluator< withdraw_permission_update_evaluator >, graphene::chain::evaluator< asset_global_settle_evaluator >, graphene::chain::evaluator< asset_settle_evaluator >, graphene::chain::evaluator< override_transfer_evaluator >, graphene::chain::evaluator< vesting_balance_create_evaluator >, graphene::chain::evaluator< transfer_to_blind_evaluator >, graphene::chain::evaluator< committee_member_update_global_parameters_evaluator >, graphene::chain::evaluator< asset_fund_fee_pool_evaluator >, graphene::chain::evaluator< samet_fund_update_evaluator >, graphene::chain::evaluator< transfer_evaluator >, graphene::chain::evaluator< asset_claim_pool_evaluator >, graphene::chain::evaluator< asset_reserve_evaluator >, graphene::chain::evaluator< withdraw_permission_delete_evaluator >, graphene::chain::evaluator< ticket_create_evaluator >, graphene::chain::evaluator< ticket_update_evaluator >, graphene::chain::evaluator< worker_create_evaluator >, graphene::chain::evaluator< samet_fund_repay_evaluator >, graphene::chain::evaluator< credit_deal_repay_evaluator >, graphene::chain::evaluator< proposal_update_evaluator >, graphene::chain::evaluator< asset_update_evaluator >, graphene::chain::evaluator< credit_deal_update_evaluator >, graphene::chain::evaluator< witness_update_evaluator >, graphene::chain::evaluator< transfer_from_blind_evaluator >, graphene::chain::evaluator< vesting_balance_withdraw_evaluator >, graphene::chain::evaluator< limit_order_update_evaluator >, graphene::chain::evaluator< liquidity_pool_deposit_evaluator >, graphene::chain::evaluator< liquidity_pool_exchange_evaluator >, graphene::chain::evaluator< credit_offer_delete_evaluator >, graphene::chain::evaluator< custom_authority_update_evaluator >, graphene::chain::evaluator< samet_fund_borrow_evaluator >, graphene::chain::evaluator< htlc_extend_evaluator >, graphene::chain::evaluator< credit_offer_accept_evaluator >, graphene::chain::evaluator< custom_evaluator >, graphene::chain::evaluator< witness_create_evaluator >, graphene::chain::evaluator< credit_offer_create_evaluator >, graphene::chain::evaluator< liquidity_pool_create_evaluator >, graphene::chain::evaluator< call_order_update_evaluator >, graphene::chain::evaluator< asset_update_bitasset_evaluator >, graphene::chain::evaluator< liquidity_pool_delete_evaluator >, graphene::chain::evaluator< bid_collateral_evaluator >, graphene::chain::evaluator< withdraw_permission_claim_evaluator >, graphene::chain::evaluator< proposal_create_evaluator >, graphene::chain::evaluator< committee_member_create_evaluator >, graphene::chain::evaluator< asset_update_feed_producers_evaluator >, graphene::chain::evaluator< asset_issue_evaluator >, graphene::chain::evaluator< liquidity_pool_update_evaluator >, and graphene::chain::evaluator< committee_member_update_evaluator >.
|
protected |
|
pure virtual |
Implemented in graphene::chain::evaluator< DerivedEvaluator >.
|
protected |
pay_fee() for FBA subclass should simply call this method
Definition at line 100 of file evaluator.cpp.
|
virtual |
Routes the fee to where it needs to go. The default implementation routes the fee to the account_statistics_object of the fee_paying_account.
Before pay_fee() is called, the fee is computed by prepare_fee() and has been moved out of the fee_paying_account and (if paid in a non-CORE asset) converted by the asset's fee pool.
Therefore, when pay_fee() is called, the fee only exists in this->core_fee_paid. So pay_fee() need only increment the receiving balance.
The default implementation simply calls account_statistics_object->pay_fee() to increment pending_fees or pending_vested_fees.
Reimplemented in graphene::chain::limit_order_update_evaluator, graphene::chain::blind_transfer_evaluator, graphene::chain::limit_order_create_evaluator, graphene::chain::transfer_from_blind_evaluator, graphene::chain::asset_create_evaluator, and graphene::chain::transfer_to_blind_evaluator.
Definition at line 91 of file evaluator.cpp.
|
protected |
Fetch objects relevant to fee payer and set pointer members.
account_id | Account which is paying the fee |
fee | The fee being paid. May be in assets other than core. |
This method verifies that the fee is valid and sets the object pointer members and the fee fields. It should be called during do_evaluate.
In particular, core_fee_paid field is set by prepare_fee().
Definition at line 51 of file evaluator.cpp.
|
virtual |
Definition at line 41 of file evaluator.cpp.
|
protected |
Definition at line 115 of file evaluator.hpp.
|
protected |
Definition at line 118 of file evaluator.hpp.
|
protected |
Definition at line 119 of file evaluator.hpp.
|
protected |
Definition at line 114 of file evaluator.hpp.
|
protected |
Definition at line 116 of file evaluator.hpp.
|
protected |
Definition at line 117 of file evaluator.hpp.
|
protected |
Definition at line 120 of file evaluator.hpp.