Graphene::Chain
-
namespace chain
Typedefs
-
typedef multi_index_container<account_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_maintenance_flag>, member<account_balance_object, bool, &account_balance_object::maintenance_flag>>, ordered_unique<tag<by_asset_balance>, composite_key<account_balance_object, member<account_balance_object, asset_id_type, &account_balance_object::asset_type>, member<account_balance_object, share_type, &account_balance_object::balance>, member<account_balance_object, account_id_type, &account_balance_object::owner>>, composite_key_compare<std::less<asset_id_type>, std::greater<share_type>, std::less<account_id_type>>>>> account_balance_object_multi_index_type
-
typedef generic_index<account_balance_object, account_balance_object_multi_index_type> account_balance_index
-
typedef multi_index_container<account_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_name>, member<account_object, string, &account_object::name>>>> account_multi_index_type
-
typedef generic_index<account_object, account_multi_index_type> account_index
-
typedef multi_index_container<account_statistics_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_maintenance_seq>, composite_key<account_statistics_object, const_mem_fun<account_statistics_object, bool, &account_statistics_object::need_maintenance>, member<account_statistics_object, string, &account_statistics_object::name>>>, ordered_non_unique<tag<by_voting_power_active>, composite_key<account_statistics_object, member<account_statistics_object, time_point_sec, &account_statistics_object::vote_tally_time>, member<account_statistics_object, uint64_t, &account_statistics_object::vp_active>>, composite_key_compare<std::greater<time_point_sec>, std::greater<uint64_t>>>>> account_stats_multi_index_type
-
typedef generic_index<account_statistics_object, account_stats_multi_index_type> account_stats_index
-
using bitasset_data_multi_index_type = multi_index_container<asset_bitasset_data_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_short_backing_asset>, bitasset_backing_asst_extractor>, ordered_unique<tag<by_feed_expiration>, composite_key<asset_bitasset_data_object, const_mem_fun<asset_bitasset_data_object, time_point_sec, &asset_bitasset_data_object::feed_expiration_time>, member<asset_bitasset_data_object, asset_id_type, &asset_bitasset_data_object::asset_id>>>, ordered_non_unique<tag<by_cer_update>, const_mem_fun<asset_bitasset_data_object, bool, &asset_bitasset_data_object::need_to_update_cer>>>>
-
using asset_bitasset_data_index = generic_index<asset_bitasset_data_object, bitasset_data_multi_index_type>
-
using asset_object_multi_index_type = multi_index_container<asset_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_symbol>, member<asset_object, string, &asset_object::symbol>>, ordered_unique<tag<by_type>, composite_key<asset_object, const_mem_fun<asset_object, bool, &asset_object::is_market_issued>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_issuer>, composite_key<asset_object, member<asset_object, account_id_type, &asset_object::issuer>, member<object, object_id_type, &object::id>>>>>
-
using asset_index = generic_index<asset_object, asset_object_multi_index_type>
-
using balance_multi_index_type = multi_index_container<balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_owner>, composite_key<balance_object, member<balance_object, address, &balance_object::owner>, const_mem_fun<balance_object, asset_id_type, &balance_object::asset_type>>>>>
-
using balance_index = generic_index<balance_object, balance_multi_index_type>
-
typedef multi_index_container<buyback_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_asset>, member<buyback_object, asset_id_type, &buyback_object::asset_to_buy>>>> buyback_multi_index_type
-
typedef generic_index<buyback_object, buyback_multi_index_type> buyback_index
-
using committee_member_multi_index_type = multi_index_container<committee_member_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, member<committee_member_object, account_id_type, &committee_member_object::committee_member_account>>, ordered_unique<tag<by_vote_id>, member<committee_member_object, vote_id_type, &committee_member_object::vote_id>>>>
-
using committee_member_index = generic_index<committee_member_object, committee_member_multi_index_type>
-
using blinded_balance_obj_multi_idx = multi_index_container<blinded_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_commitment>, member<blinded_balance_object, commitment_type, &blinded_balance_object::commitment>>>>
-
using blinded_balance_index = generic_index<blinded_balance_object, blinded_balance_obj_multi_idx>
-
using credit_offer_multi_index_type = multi_index_container<credit_offer_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_auto_disable_time>, composite_key<credit_offer_object, member<credit_offer_object, bool, &credit_offer_object::enabled>, member<credit_offer_object, time_point_sec, &credit_offer_object::auto_disable_time>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_owner>, composite_key<credit_offer_object, member<credit_offer_object, account_id_type, &credit_offer_object::owner_account>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_asset_type>, composite_key<credit_offer_object, member<credit_offer_object, asset_id_type, &credit_offer_object::asset_type>, member<object, object_id_type, &object::id>>>>>
-
using credit_offer_index = generic_index<credit_offer_object, credit_offer_multi_index_type>
-
using credit_deal_multi_index_type = multi_index_container<credit_deal_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_latest_repay_time>, composite_key<credit_deal_object, member<credit_deal_object, time_point_sec, &credit_deal_object::latest_repay_time>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_offer_id>, composite_key<credit_deal_object, member<credit_deal_object, credit_offer_id_type, &credit_deal_object::offer_id>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_offer_owner>, composite_key<credit_deal_object, member<credit_deal_object, account_id_type, &credit_deal_object::offer_owner>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_borrower>, composite_key<credit_deal_object, member<credit_deal_object, account_id_type, &credit_deal_object::borrower>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_debt_asset>, composite_key<credit_deal_object, member<credit_deal_object, asset_id_type, &credit_deal_object::debt_asset>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_collateral_asset>, composite_key<credit_deal_object, member<credit_deal_object, asset_id_type, &credit_deal_object::collateral_asset>, member<object, object_id_type, &object::id>>>>>
-
using credit_deal_index = generic_index<credit_deal_object, credit_deal_multi_index_type>
-
using credit_deal_summary_index_type = multi_index_container<credit_deal_summary_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_offer_borrower>, composite_key<credit_deal_summary_object, member<credit_deal_summary_object, credit_offer_id_type, &credit_deal_summary_object::offer_id>, member<credit_deal_summary_object, account_id_type, &credit_deal_summary_object::borrower>>>>>
-
using credit_deal_summary_index = generic_index<credit_deal_summary_object, credit_deal_summary_index_type>
-
typedef multi_index_container<custom_authority_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account_custom>, composite_key<custom_authority_object, member<custom_authority_object, account_id_type, &custom_authority_object::account>, member<custom_authority_object, unsigned_int, &custom_authority_object::operation_type>, member<custom_authority_object, bool, &custom_authority_object::enabled>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_expiration>, composite_key<custom_authority_object, member<custom_authority_object, time_point_sec, &custom_authority_object::valid_to>, member<object, object_id_type, &object::id>>>>> custom_authority_multi_index_type
-
using custom_authority_index = generic_index<custom_authority_object, custom_authority_multi_index_type>
-
using htlc_object_multi_index_type = multi_index_container<htlc_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_expiration>, composite_key<htlc_object, htlc_object::timelock_extractor, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_from_id>, composite_key<htlc_object, htlc_object::from_extractor, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_to_id>, composite_key<htlc_object, htlc_object::to_extractor, member<object, object_id_type, &object::id>>>>>
-
using htlc_index = generic_index<htlc_object, htlc_object_multi_index_type>
-
typedef multi_index_container<liquidity_pool_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_share_asset>, member<liquidity_pool_object, asset_id_type, &liquidity_pool_object::share_asset>>, ordered_unique<tag<by_asset_a>, composite_key<liquidity_pool_object, member<liquidity_pool_object, asset_id_type, &liquidity_pool_object::asset_a>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_asset_b>, composite_key<liquidity_pool_object, member<liquidity_pool_object, asset_id_type, &liquidity_pool_object::asset_b>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_asset_ab>, composite_key<liquidity_pool_object, member<liquidity_pool_object, asset_id_type, &liquidity_pool_object::asset_a>, member<liquidity_pool_object, asset_id_type, &liquidity_pool_object::asset_b>, member<object, object_id_type, &object::id>>>>> liquidity_pool_multi_index_type
-
typedef generic_index<liquidity_pool_object, liquidity_pool_multi_index_type> liquidity_pool_index
-
typedef multi_index_container<limit_order_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_expiration>, composite_key<limit_order_object, member<limit_order_object, time_point_sec, &limit_order_object::expiration>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_price>, composite_key<limit_order_object, member<limit_order_object, price, &limit_order_object::sell_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::greater<price>, std::less<object_id_type>>>, ordered_unique<tag<by_is_settled_debt>, composite_key<limit_order_object, member<limit_order_object, bool, &limit_order_object::is_settled_debt>, const_mem_fun<limit_order_object, asset_id_type, &limit_order_object::receive_asset_id>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_account>, composite_key<limit_order_object, member<limit_order_object, account_id_type, &limit_order_object::seller>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_account_price>, composite_key<limit_order_object, member<limit_order_object, account_id_type, &limit_order_object::seller>, member<limit_order_object, price, &limit_order_object::sell_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::less<account_id_type>, std::greater<price>, std::less<object_id_type>>>>> limit_order_multi_index_type
-
typedef generic_index<limit_order_object, limit_order_multi_index_type> limit_order_index
-
typedef multi_index_container<call_order_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_price>, composite_key<call_order_object, member<call_order_object, price, &call_order_object::call_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::less<price>, std::less<object_id_type>>>, ordered_unique<tag<by_account>, composite_key<call_order_object, member<call_order_object, account_id_type, &call_order_object::borrower>, const_mem_fun<call_order_object, asset_id_type, &call_order_object::debt_type>>>, ordered_unique<tag<by_collateral>, composite_key<call_order_object, const_mem_fun<call_order_object, price, &call_order_object::collateralization>, member<object, object_id_type, &object::id>>>>> call_order_multi_index_type
-
typedef multi_index_container<force_settlement_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, composite_key<force_settlement_object, member<force_settlement_object, account_id_type, &force_settlement_object::owner>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_expiration>, composite_key<force_settlement_object, const_mem_fun<force_settlement_object, asset_id_type, &force_settlement_object::settlement_asset_id>, member<force_settlement_object, time_point_sec, &force_settlement_object::settlement_date>, member<object, object_id_type, &object::id>>>>> force_settlement_object_multi_index_type
-
typedef multi_index_container<collateral_bid_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, composite_key<collateral_bid_object, const_mem_fun<collateral_bid_object, asset_id_type, &collateral_bid_object::debt_type>, member<collateral_bid_object, account_id_type, &collateral_bid_object::bidder>>>, ordered_unique<tag<by_price>, composite_key<collateral_bid_object, const_mem_fun<collateral_bid_object, asset_id_type, &collateral_bid_object::debt_type>, member<collateral_bid_object, price, &collateral_bid_object::inv_swan_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::less<asset_id_type>, std::greater<price>, std::less<object_id_type>>>>> collateral_bid_object_multi_index_type
-
typedef generic_index<call_order_object, call_order_multi_index_type> call_order_index
-
typedef generic_index<force_settlement_object, force_settlement_object_multi_index_type> force_settlement_index
-
typedef generic_index<collateral_bid_object, collateral_bid_object_multi_index_type> collateral_bid_index
-
using operation_history_mlti_idx_type = multi_index_container<operation_history_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_block>, composite_key<operation_history_object, member<operation_history_object, uint32_t, &operation_history_object::block_num>, member<operation_history_object, uint16_t, &operation_history_object::trx_in_block>, member<operation_history_object, uint16_t, &operation_history_object::op_in_trx>, member<operation_history_object, uint32_t, &operation_history_object::virtual_op>>>, ordered_unique<tag<by_time>, composite_key<operation_history_object, member<operation_history_object, time_point_sec, &operation_history_object::block_time>, member<object, object_id_type, &object::id>>, composite_key_compare<std::greater<time_point_sec>, std::greater<object_id_type>>>>>
-
using operation_history_index = generic_index<operation_history_object, operation_history_mlti_idx_type>
-
using account_history_multi_idx_type = multi_index_container<account_history_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_seq>, composite_key<account_history_object, member<account_history_object, account_id_type, &account_history_object::account>, member<account_history_object, uint64_t, &account_history_object::sequence>>>, ordered_unique<tag<by_op>, composite_key<account_history_object, member<account_history_object, account_id_type, &account_history_object::account>, member<account_history_object, operation_history_id_type, &account_history_object::operation_id>>, composite_key_compare<std::less<account_id_type>, std::greater<operation_history_id_type>>>, ordered_non_unique<tag<by_opid>, member<account_history_object, operation_history_id_type, &account_history_object::operation_id>>>>
-
using account_history_index = generic_index<account_history_object, account_history_multi_idx_type>
-
typedef boost::multi_index_container<proposal_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_expiration>, composite_key<proposal_object, member<proposal_object, time_point_sec, &proposal_object::expiration_time>, member<object, object_id_type, &object::id>>>>> proposal_multi_index_container
-
typedef generic_index<proposal_object, proposal_multi_index_container> proposal_index
-
using samet_fund_multi_index_type = multi_index_container<samet_fund_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_unpaid>, composite_key<samet_fund_object, member<samet_fund_object, share_type, &samet_fund_object::unpaid_amount>, member<object, object_id_type, &object::id>>, composite_key_compare<std::greater<share_type>, std::less<object_id_type>>>, ordered_unique<tag<by_owner>, composite_key<samet_fund_object, member<samet_fund_object, account_id_type, &samet_fund_object::owner_account>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_asset_type>, composite_key<samet_fund_object, member<samet_fund_object, asset_id_type, &samet_fund_object::asset_type>, member<object, object_id_type, &object::id>>>>>
-
using samet_fund_index = generic_index<samet_fund_object, samet_fund_multi_index_type>
-
using special_authority_multi_idx_typ = multi_index_container<special_authority_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, member<special_authority_object, account_id_type, &special_authority_object::account>>>>
-
using special_authority_index = generic_index<special_authority_object, special_authority_multi_idx_typ>
-
typedef multi_index_container<ticket_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_next_update>, composite_key<ticket_object, member<ticket_object, time_point_sec, &ticket_object::next_auto_update_time>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_account>, composite_key<ticket_object, member<ticket_object, account_id_type, &ticket_object::account>, member<object, object_id_type, &object::id>>>>> ticket_multi_index_type
-
typedef generic_index<ticket_object, ticket_multi_index_type> ticket_index
-
typedef multi_index_container<transaction_history_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, hashed_unique<tag<by_trx_id>, BOOST_MULTI_INDEX_MEMBER(transaction_history_object, transaction_id_type, trx_id), std::hash<transaction_id_type>>, ordered_non_unique<tag<by_expiration>, const_mem_fun<transaction_history_object, time_point_sec, &transaction_history_object::get_expiration>>>> transaction_multi_index_type
-
typedef generic_index<transaction_history_object, transaction_multi_index_type> transaction_index
-
typedef fc::static_variant<linear_vesting_policy, cdd_vesting_policy, instant_vesting_policy> vesting_policy
-
typedef multi_index_container<vesting_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_account>, member<vesting_balance_object, account_id_type, &vesting_balance_object::owner>>, hashed_unique<tag<by_vesting_type>, identity<vesting_balance_object>, detail::vesting_balance_object_hash, detail::vesting_balance_object_equal>>> vesting_balance_multi_index_type
-
typedef generic_index<vesting_balance_object, vesting_balance_multi_index_type> vesting_balance_index
-
using withdraw_permission_obj_mlt_idx = multi_index_container<withdraw_permission_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_from>, composite_key<withdraw_permission_object, member<withdraw_permission_object, account_id_type, &withdraw_permission_object::withdraw_from_account>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_authorized>, composite_key<withdraw_permission_object, member<withdraw_permission_object, account_id_type, &withdraw_permission_object::authorized_account>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_expiration>, composite_key<withdraw_permission_object, member<withdraw_permission_object, time_point_sec, &withdraw_permission_object::expiration>, member<object, object_id_type, &object::id>>>>>
-
using withdraw_permission_index = generic_index<withdraw_permission_object, withdraw_permission_obj_mlt_idx>
-
using witness_multi_index_type = multi_index_container<witness_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, member<witness_object, account_id_type, &witness_object::witness_account>>, ordered_unique<tag<by_vote_id>, member<witness_object, vote_id_type, &witness_object::vote_id>>>>
-
using witness_index = generic_index<witness_object, witness_multi_index_type>
-
typedef static_variant<refund_worker_type, vesting_balance_worker_type, burn_worker_type> worker_type
-
typedef multi_index_container<worker_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_account>, member<worker_object, account_id_type, &worker_object::worker_account>>, ordered_unique<tag<by_vote_for>, member<worker_object, vote_id_type, &worker_object::vote_for>>, ordered_unique<tag<by_vote_against>, member<worker_object, vote_id_type, &worker_object::vote_against>>, ordered_non_unique<tag<by_end_date>, member<worker_object, time_point_sec, &worker_object::work_end_date>>>> worker_object_multi_index_type
-
using worker_index = generic_index<worker_object, worker_object_multi_index_type>
Enums
-
enum graphene_fba_accumulator_id_enum
An object will be created at genesis for each of these FBA accumulators.
Values:
-
enumerator fba_accumulator_id_transfer_to_blind
-
enumerator fba_accumulator_id_blind_transfer
-
enumerator fba_accumulator_id_transfer_from_blind
-
enumerator fba_accumulator_id_count
-
enumerator fba_accumulator_id_transfer_to_blind
Functions
-
static void validate_new_issuer(const database &d, const asset_object &a, account_id_type new_issuer)
-
void check_children_of_bitasset(const database &d, const asset_update_bitasset_operation &op, const asset_object &new_backing_asset)
-
static bool update_bitasset_object_options(const asset_update_bitasset_operation &op, database &db, asset_bitasset_data_object &bdo, const asset_object &asset_to_update, bool update_feeds_due_to_bsrm_change)
-
static optional<asset> pay_collateral_fees(database &d, const asset &pays, const asset &settled_amount, const asset_object &asset_to_settle, const asset_bitasset_data_object &bitasset)
-
static extendable_operation_result pay_settle_from_gs_fund(database &d, const asset_settle_evaluator::operation_type &op, const account_object *fee_paying_account, const asset_object &asset_to_settle, const asset_bitasset_data_object &bitasset)
-
static extendable_operation_result pay_settle_from_individual_pool(database &d, const asset_settle_evaluator::operation_type &op, const account_object *fee_paying_account, const asset_object &asset_to_settle, const asset_bitasset_data_object &bitasset)
-
void split_fba_balance(database &db, uint64_t fba_id, uint16_t network_pct, uint16_t designated_asset_buyback_pct, uint16_t designated_asset_issuer_pct)
-
void update_call_orders_hf_343(database &db)
Reset call_price of all call orders according to their remaining collateral and debt. Do not update orders of prediction markets because we’re sure they’re up to date.
-
void update_call_orders_hf_1270(database &db)
Reset call_price of all call orders to (1,1) since it won’t be used in the future. Update PMs as well.
-
void delete_expired_custom_auths(database &db)
Remove any custom active authorities whose expiration dates are in the past.
- Parameters:
db – A mutable database reference
-
void process_hf_2262(database &db)
A one-time data process to set values of existing liquid tickets to zero.
-
void process_hf_2281(database &db)
A one-time data process to cancel all collateral bids for assets that disabled collateral bidding already.
-
bool maybe_cull_small_order(database &db, const limit_order_object &order)
-
static database::match_result_type get_match_result(bool taker_filled, bool maker_filled)
Helper function.
-
void operation_get_impacted_accounts(const operation &op, flat_set<account_id_type> &result, bool ignore_custom_op_required_auths)
-
void transaction_get_impacted_accs(const transaction &tx, flat_set<account_id_type> &result, bool ignore_custom_op_required_auths)
-
static void get_relevant_accounts(const object *obj, flat_set<account_id_type> &accounts, bool ignore_custom_op_required_auths)
-
static optional<price> get_derived_current_feed_price(const database &db, const asset_bitasset_data_object &bitasset)
-
static void update_settled_debt_order(database &db, const asset_bitasset_data_object &bitasset)
- FC_IMPLEMENT_DERIVED_EXCEPTION (database_query_exception, chain_exception, 3010000, "database query exception") FC_IMPLEMENT_DERIVED_EXCEPTION(block_validate_exception
- block validation exception FC_IMPLEMENT_DERIVED_EXCEPTION (transaction_process_exception, chain_exception, 3030000, "transaction processing exception") FC_IMPLEMENT_DERIVED_EXCEPTION(operation_validate_exception
- block validation exception operation validation exception FC_IMPLEMENT_DERIVED_EXCEPTION (operation_evaluate_exception, chain_exception, 3050000, "operation evaluation exception") FC_IMPLEMENT_DERIVED_EXCEPTION(utility_exception
- block validation exception operation validation exception utility method exception FC_IMPLEMENT_DERIVED_EXCEPTION (undo_database_exception, chain_exception, 3070000, "undo database exception") FC_IMPLEMENT_DERIVED_EXCEPTION(duplicate_transaction
- block validation exception operation validation exception utility method exception duplicate transaction FC_IMPLEMENT_DERIVED_EXCEPTION (pop_empty_chain, undo_database_exception, 3070001, "there are no blocks to pop") GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(transfer)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(limit_order_create)
- GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (kill_unfilled, limit_order_create, 1, "Killing limit order due to unable to fill") GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION(market_not_whitelisted
- The market has not been whitelisted by the selling asset GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (market_blacklisted, limit_order_create, 3, "The market has been blacklisted by the selling asset") GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION(selling_asset_unauthorized
- The market has not been whitelisted by the selling asset The account is not allowed to transact the selling asset GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (receiving_asset_unauthorized, limit_order_create, 5, "The account is not allowed to transact the receiving asset") GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION(insufficient_balance
- The market has not been whitelisted by the selling asset The account is not allowed to transact the selling asset Insufficient balance GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS (limit_order_update)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(limit_order_cancel)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(call_order_update)
- GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (unfilled_margin_call, call_order_update, 1, "Updating call order would trigger a margin call that cannot be fully filled") GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(account_create)
- GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (buyback_incorrect_issuer, account_create, 3, "Incorrect issuer specified for account") GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION(buyback_already_exists
- Cannot create buyback for asset which already has buyback GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS (account_update)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(asset_reserve)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(proposal_create)
- GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (review_period_insufficient, proposal_create, 2, "review_period insufficient") GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(balance_claim)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(override_transfer)
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(blind_transfer)
- GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (unknown_commitment, blind_transfer, 1, "Attempting to claim an unknown prior commitment")
-
GRAPHENE_IMPLEMENT_OP_BASE_EXCEPTIONS(liquidity_pool_exchange)
- GRAPHENE_IMPLEMENT_OP_EVALUATE_EXCEPTION (unfillable_price, liquidity_pool_exchange, 1, "Unable to exchange at expected price")
-
fc::variant_object get_config()
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(transfer)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(limit_order_create)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(limit_order_update)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(limit_order_cancel)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(call_order_update)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(account_create)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(account_update)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(asset_reserve)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(proposal_create)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(balance_claim)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(override_transfer)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(blind_transfer)
-
GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS(liquidity_pool_exchange)
-
void operation_get_impacted_accounts(const graphene::chain::operation &op, fc::flat_set<graphene::chain::account_id_type> &result, bool ignore_custom_operation_required_auths)
-
void transaction_get_impacted_accounts(const graphene::chain::transaction &tx, fc::flat_set<graphene::chain::account_id_type> &result, bool ignore_custom_operation_required_auths)
-
inline bool is_authorized_asset(const database &d, const account_object &acct, const asset_object &asset_obj)
- Returns:
true if the account is whitelisted and not blacklisted to transact in the provided asset; false otherwise.
- VESTING_VISITOR (on_deposit,)
- VESTING_VISITOR (on_deposit_vested,)
- VESTING_VISITOR (on_withdraw,)
- VESTING_VISITOR (is_deposit_allowed, const)
- VESTING_VISITOR (is_deposit_vested_allowed, const)
- VESTING_VISITOR (is_withdraw_allowed, const)
- VESTING_VISITOR (get_allowed_withdraw, const)
Variables
-
static const uint32_t skip_expensive = database::skip_transaction_signatures | database::skip_witness_signature | database::skip_merkle_check | database::skip_transaction_dupe_check
- chain_exception
- block validation exception operation validation exception utility method exception transaction_process_exception
- limit_order_create
- account_create
-
class account_balance_object : public graphene::db::abstract_object<account_balance_object, implementation_ids, impl_account_balance_object_type>
- #include <account_object.hpp>
Tracks the balance of a single account/asset pair.
This object is indexed on owner and asset_type so that black swan events in asset_type can be processed quickly.
Public Members
-
bool maintenance_flag = false
Whether need to process this balance object in maintenance interval.
-
bool maintenance_flag = false
-
class account_create_evaluator : public graphene::chain::evaluator<account_create_evaluator>
- #include <account_evaluator.hpp>
-
class account_history_object : public graphene::db::abstract_object<account_history_object, implementation_ids, impl_account_history_object_type>
- #include <operation_history_object.hpp>
a node in a linked list of operation_history_objects
Account history is important for users and wallets even though it is not part of “core validation”. Account history is maintained as a linked list stored on disk in a stack. Each account will point to the most recent account history object by ID. When a new operation relativent to that account is processed a new account history object is allcoated at the end of the stack and intialized to point to the prior object.
This data is never accessed as part of chain validation and therefore can be kept on disk as a memory mapped file. Using a memory mapped file will help the operating system better manage / cache / page files and also accelerates load time.
When the transaction history for a particular account is requested the linked list can be traversed with relatively effecient disk access because of the use of a memory mapped stack.
-
class account_member_index : public graphene::db::secondary_index
- #include <account_object.hpp>
This secondary index will allow a reverse lookup of all accounts that a particular key or account is an potential signing authority.
Public Members
-
map<account_id_type, set<account_id_type>> account_to_account_memberships
given an account or key, map it to the set of accounts that reference it in an active or owner authority
-
map<address, set<account_id_type>> account_to_address_memberships
some accounts use address authorities in the genesis block
-
map<account_id_type, set<account_id_type>> account_to_account_memberships
-
class account_object : public graphene::db::abstract_object<account_object, protocol_ids, account_object_type>
- #include <account_object.hpp>
This class represents an account on the object graph.
Accounts are the primary unit of authority on the graphene system. Users must have an account in order to use assets, trade in the markets, vote for committee_members, etc.
Unnamed Group
-
set<account_id_type> whitelisted_accounts
Optionally track all of the accounts this account has whitelisted or blacklisted, these should be made Immutable so that when the account object is cloned no deep copy is required. This state is tracked for GUI display purposes.
TODO: move white list tracking to its own multi-index container rather than having 4 fields on an account. This will scale better because under the current design if you whitelist 2000 accounts, then every time someone fetches this account object they will get the full list of 2000 accounts.
Public Functions
-
inline bool is_lifetime_member() const
- Returns:
true if this is a lifetime member account; false otherwise.
-
inline bool is_basic_account(time_point_sec now) const
- Returns:
true if this is a basic account; false otherwise.
-
inline bool is_annual_member(time_point_sec now) const
Note
This method will return false for lifetime members.
- Returns:
true if the account is an unexpired annual member; false otherwise.
-
inline bool is_member(time_point_sec now) const
- Returns:
true if the account is an annual or lifetime member; false otherwise.
Public Members
-
time_point_sec membership_expiration_date
The time at which this account’s membership expires. If set to any time in the past, the account is a basic account. If set to time_point_sec::maximum(), the account is a lifetime member. If set to any time not in the past less than time_point_sec::maximum(), the account is an annual member.
See is_lifetime_member, is_basic_account, is_annual_member, and is_member
-
account_id_type registrar
The account that paid the fee to register this account. Receives a percentage of referral rewards.
-
account_id_type referrer
The account credited as referring this account. Receives a percentage of referral rewards.
-
account_id_type lifetime_referrer
The lifetime member at the top of the referral tree. Receives a percentage of referral rewards.
-
uint16_t network_fee_percentage = GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE
Percentage of fee which should go to network.
-
uint16_t lifetime_referrer_fee_percentage = 0
Percentage of fee which should go to lifetime referrer.
-
uint16_t referrer_rewards_percentage = 0
Percentage of referral rewards (leftover fee after paying network and lifetime referrer) which should go to referrer. The remainder of referral rewards goes to the registrar.
-
string name
The account’s name. This name must be unique among all account names on the graph. May not be empty.
-
authority owner
The owner authority represents absolute control over the account. Usually the keys in this authority will be kept in cold storage, as they should not be needed very often and compromise of these keys constitutes complete and irrevocable loss of the account. Generally the only time the owner authority is required is to update the active authority.
-
authority active
The owner authority contains the hot keys of the account. This authority has control over nearly all operations the account may perform.
-
uint16_t num_committee_voted
Pre-calculated for better performance on chain maintenance.
-
account_statistics_id_type statistics
The reference implementation records the account’s statistics in a separate object. This field contains the ID of that object.
-
flat_set<account_id_type> whitelisting_accounts
This is a set of all accounts which have ‘whitelisted’ this account. Whitelisting is only used in core validation for the purpose of authorizing accounts to hold and transact in whitelisted assets. This account cannot update this set, except by transferring ownership of the account, which will clear it. Other accounts may add or remove their IDs from this set.
-
flat_set<account_id_type> blacklisting_accounts
This is a set of all accounts which have ‘blacklisted’ this account. Blacklisting is only used in core validation for the purpose of forbidding accounts from holding and transacting in whitelisted assets. This account cannot update this set, and it will be preserved even if the account is transferred. Other accounts may add or remove their IDs from this set.
-
optional<vesting_balance_id_type> cashback_vb
Vesting balance which receives cashback_reward deposits.
-
uint8_t top_n_control_flags = 0
This flag is set when the top_n logic sets both authorities, and gets reset when authority or special_authority is set.
-
optional<flat_set<asset_id_type>> allowed_assets
This is a set of assets which the account is allowed to have. This is utilized to restrict buyback accounts to the assets that trade in their markets. In the future we may expand this to allow accounts to e.g. voluntarily restrict incoming transfers.
-
uint32_t creation_block_num = 0
The block number when the account was created.
-
time_point_sec creation_time
The time when the account was created.
-
set<account_id_type> whitelisted_accounts
-
class account_statistics_object : public graphene::db::abstract_object<account_statistics_object, implementation_ids, impl_account_statistics_object_type>
- #include <account_object.hpp>
This object contains regularly updated statistical data about an account. It is provided for the purpose of separating the account data that changes frequently from the account data that is mostly static, which will minimize the amount of data that must be backed up as part of the undo history everytime a transfer is made.
Unnamed Group
-
uint64_t vp_all = 0
all voting power.
Voting Power Stats
-
uint64_t vp_active = 0
active voting power, if there is no attenuation, it is equal to vp_all.
-
uint64_t vp_committee = 0
the final voting power for the committees.
-
uint64_t vp_witness = 0
the final voting power for the witnesses.
-
uint64_t vp_worker = 0
the final voting power for the workers.
-
time_point_sec vote_tally_time
Timestamp of the last count of votes. If there is no statistics, the date is less than
_db.get_dynamic_global_properties().last_vote_tally_time.
Public Functions
-
inline bool has_some_core_voting() const
Whether this account owns some CORE asset and is voting.
-
inline bool has_pending_fees() const
Whether this account has pending fees, no matter vested or not.
-
inline bool need_maintenance() const
Whether need to process this account during the maintenance interval.
-
void process_fees(const account_object &a, database &d) const
Split up and pay out pending_fees and pending_vested_fees.
Core fees are paid into the account_statistics_object by this method
Public Members
-
string name
redundantly store account name here for better maintenance performance
-
account_history_id_type most_recent_op
Keep the most recent operation as a root pointer to a linked list of the transaction history.
-
uint64_t total_ops = 0
Total operations related to this account.
-
uint64_t removed_ops = 0
Total operations related to this account that has been removed from the database.
-
share_type total_core_in_orders
When calculating votes it is necessary to know how much is stored in orders (and thus unavailable for transfers). Rather than maintaining an index of [asset,owner,order_id] we will simply maintain the running total here and update it every time an order is created or modified.
-
share_type total_core_inactive
Total amount of core token in inactive lock_forever tickets.
-
share_type total_core_pob
Total amount of core token in active lock_forever tickets.
-
share_type total_core_pol
Total amount of core token in other tickets.
-
share_type total_pob_value
Total value of tickets whose current type is lock_forever.
-
share_type total_pol_value
Total value of tickets whose current type is not lock_forever.
-
share_type core_in_balance
Redundantly store core balance in this object for better maintenance performance. Only updates on maintenance.
-
bool has_cashback_vb = false
redundantly store this for better maintenance performance
-
bool is_voting = false
redundately store “if this account is voting” for better maintenance performance
-
time_point_sec last_vote_time
last time voted
-
share_type lifetime_fees_paid
Tracks the total fees paid by this account for the purpose of calculating bulk discounts.
-
share_type pending_fees
Tracks the fees paid by this account which have not been disseminated to the various parties that receive them yet (registrar, referrer, lifetime referrer, network, etc). This is used as an optimization to avoid doing massive amounts of uint128 arithmetic on each and every operation.
These fees will be paid out as vesting cash-back, and this counter will reset during the maintenance interval.
-
share_type pending_vested_fees
Same as pending_fees, except these fees will be paid out as pre-vested cash-back (immediately available for withdrawal) rather than requiring the normal vesting period.
-
uint64_t vp_all = 0
-
class account_update_evaluator : public graphene::chain::evaluator<account_update_evaluator>
- #include <account_evaluator.hpp>
-
class account_upgrade_evaluator : public graphene::chain::evaluator<account_upgrade_evaluator>
- #include <account_evaluator.hpp>
-
class account_whitelist_evaluator : public graphene::chain::evaluator<account_whitelist_evaluator>
- #include <account_evaluator.hpp>
-
class assert_evaluator : public graphene::chain::evaluator<assert_evaluator>
- #include <assert_evaluator.hpp>
-
class asset_bitasset_data_object : public graphene::db::abstract_object<asset_bitasset_data_object, implementation_ids, impl_asset_bitasset_data_object_type>
- #include <asset_object.hpp>
contains properties that only apply to bitassets (market issued assets)
Unnamed Group
-
price settlement_price
In the event of global settlement, all margin positions are settled with the siezed collateral being moved into the settlement fund. From this point on forced settlement occurs immediately when requested, using the settlement price and fund.
Note
After the core-2591 hardfork, forced settlements may be paid at the margin call order price (MCOP) when applicable, but are not limited to the settlement price stated here. Price at which force settlements of a globally settled asset will occur
-
share_type settlement_fund
Amount of collateral which is available for force settlement due to global settlement.
Unnamed Group
-
share_type individual_settlement_debt
The individual settlement pool. In the event of individual settlements (to fund or to order), debt and collateral of the margin positions which got settled are moved here.
For individual settlement to fund, collateral assets in the pool can only be retrieved through forced settlements.
For individual settlement to order, collateral assets in the pool can only be retrieved through limit orders.
Amount of debt due to individual settlements
-
share_type individual_settlement_fund
Amount of collateral due to individual settlements.
Public Functions
-
inline bool is_current_feed_price_capped() const
- Returns:
whether current_feed is different from median_feed
Calculate the maximum force settlement volume per maintenance interval, given the current share supply.
-
inline bool is_globally_settled() const
- Returns:
true if the bitasset has been globally settled, false otherwise
-
inline bool is_individually_settled_to_fund() const
- Returns:
true if the individual settlement pool is not empty and the bitasset’s black swan response method (BSRM) is graphene::protocol::bitasset_options::black_swan_response_type::individual_settlement_to_fund, false otherwise
-
inline price get_individual_settlement_price() const
Get the price of the individual settlement pool.
-
inline bitasset_options::black_swan_response_type get_black_swan_response_method() const
Get the effective black swan response method of this bitasset.
-
inline price get_margin_call_order_price() const
Get margin call order price (MCOP) of this bitasset.
-
inline ratio_type get_margin_call_order_ratio() const
Get margin call order ratio (MCOR) of this bitasset.
-
inline ratio_type get_margin_call_pays_ratio() const
Get margin call pays ratio (MCPR) of this bitasset.
-
inline bool need_to_update_cer() const
Whether need to update core_exchange_rate in asset_object.
-
inline time_point_sec feed_expiration_time() const
The time when current_feed would expire.
-
inline bool feed_is_expired_before_hf_615(time_point_sec current_time) const
The old and buggy implementation of feed_is_expired before the No. 615 hardfork. See https://github.com/cryptonomex/graphene/issues/615
-
inline bool feed_is_expired(time_point_sec current_time) const
- Returns:
whether current_feed has expired
Public Members
-
asset_id_type asset_id
The asset this object belong to.
-
bitasset_options options
The tunable options for BitAssets are stored in this field.
-
flat_map<account_id_type, pair<time_point_sec, price_feed_with_icr>> feeds
Feeds published for this asset. The keys in this map are the feed publishing accounts. The timestamp on each feed is the time it was published.
-
price_feed_with_icr median_feed
This is the median of values from the currently active feeds.
-
price_feed_with_icr current_feed
This is the currently active price feed, calculated from median_feed and other parameters.
-
time_point_sec current_feed_publication_time
This is the publication time of the oldest feed which was factored into current_feed.
-
price current_maintenance_collateralization
Call orders with collateralization (aka collateral/debt) not greater than this value are in margin call territory. This value is derived from current_feed for better performance and should be kept consistent.
-
price current_initial_collateralization
After BSIP77, when creating a new debt position or updating an existing position, the position will be checked against the
initial_collateral_ratio(ICR) parameter in the bitasset options. This value is derived from current_feed (which includesICR) for better performance and should be kept consistent.
-
bool is_prediction_market = false
True if this asset implements a Prediction Market.
-
share_type force_settled_volume
This is the volume of this asset which has been force-settled this maintanence interval.
-
bool asset_cer_updated = false
Track whether core_exchange_rate in corresponding asset_object has updated.
-
bool feed_cer_updated = false
Track whether core exchange rate in current feed has updated.
-
price settlement_price
-
class asset_claim_fees_evaluator : public graphene::chain::evaluator<asset_claim_fees_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_claim_pool_evaluator : public graphene::chain::evaluator<asset_claim_pool_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_create_evaluator : public graphene::chain::evaluator<asset_create_evaluator>
- #include <asset_evaluator.hpp>
Public Functions
-
virtual void pay_fee() override
override the default behavior defined by generic_evalautor which is to post the fee to fee_paying_account_stats.pending_fees
-
virtual void pay_fee() override
-
class asset_dynamic_data_object : public graphene::db::abstract_object<asset_dynamic_data_object, implementation_ids, impl_asset_dynamic_data_object_type>
- #include <asset_object.hpp>
tracks the asset information that changes frequently
Because the asset_object is very large it doesn’t make sense to save an undo state for all of the parameters that never change. This object factors out the parameters of an asset that change in almost every transaction that involves the asset.
This object exists as an implementation detail and its ID should never be referenced by a blockchain operation.
Public Members
-
share_type current_supply
The number of shares currently in existence.
-
share_type confidential_supply
total asset held in confidential balances
-
share_type accumulated_fees
fees accumulate to be paid out over time
-
share_type accumulated_collateral_fees
accumulated collateral-denominated fees (for bitassets)
-
share_type fee_pool
in core asset
-
share_type current_supply
-
class asset_fund_fee_pool_evaluator : public graphene::chain::evaluator<asset_fund_fee_pool_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_global_settle_evaluator : public graphene::chain::evaluator<asset_global_settle_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_issue_evaluator : public graphene::chain::evaluator<asset_issue_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_object : public graphene::db::abstract_object<asset_object, protocol_ids, asset_object_type>
- #include <asset_object.hpp>
tracks the parameters of an asset
All assets have a globally unique symbol name that controls how they are traded and an issuer who has authority over the parameters of the asset.
Subclassed by graphene::app::extended_asset_object
Public Functions
-
inline bool is_market_issued() const
- Returns:
true if this is a market-issued asset; false otherwise.
- Returns:
true if this is a share asset of a liquidity pool; false otherwise.
-
inline bool can_force_settle() const
- Returns:
true if users may request force-settlement of this market-issued asset; false otherwise
-
inline bool can_global_settle() const
- Returns:
true if the issuer of this market-issued asset may globally settle the asset; false otherwise
-
inline bool charges_market_fees() const
- Returns:
true if this asset charges a fee for the issuer on market operations; false otherwise
-
inline bool is_transfer_restricted() const
- Returns:
true if this asset may only be transferred to/from the issuer or market orders
-
inline bool can_update_max_supply() const
- Returns:
true if max supply of the asset can be updated
-
inline bool can_create_new_supply() const
- Returns:
true if can create new supply for the asset
-
inline bool can_owner_update_mcr() const
- Returns:
true if the asset owner can update MCR directly
-
inline bool can_owner_update_icr() const
- Returns:
true if the asset owner can update ICR directly
-
inline bool can_owner_update_mssr() const
- Returns:
true if the asset owner can update MSSR directly
-
inline bool can_owner_update_bsrm() const
- Returns:
true if the asset owner can change black swan response method
-
inline bool can_bid_collateral() const
- Returns:
true if can bid collateral for the asset
Helper function to get an asset object with the given amount in this asset’s type.
-
asset amount_from_string(string amount_string) const
Convert a string amount (i.e. “123.45”) to an asset object with this asset’s type The string may have a decimal and/or a negative sign.
Convert an asset to a textual representation, i.e. “123.45”.
-
inline string amount_to_string(const asset &amount) const
Convert an asset to a textual representation, i.e. “123.45”.
Convert an asset to a textual representation with symbol, i.e. “123.45 USD”.
-
inline string amount_to_pretty_string(const asset &amount) const
Convert an asset to a textual representation with symbol, i.e. “123.45 USD”.
The total amount of an asset that is reserved for future issuance.
Public Members
-
string symbol
Ticker symbol for this asset, i.e. “USD”.
-
uint8_t precision = 0
Maximum number of digits after the decimal point (must be <= 12)
-
account_id_type issuer
ID of the account which issued this asset.
-
asset_dynamic_data_id_type dynamic_asset_data_id
Current supply, fee pool, and collected fees are stored in a separate object as they change frequently.
-
optional<asset_bitasset_data_id_type> bitasset_data_id
Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() returns true.
-
optional<liquidity_pool_id_type> for_liquidity_pool
The ID of the liquidity pool if the asset is the share asset of a liquidity pool.
-
uint32_t creation_block_num = 0
The block number when the asset object was created.
-
time_point_sec creation_time
The time when the asset object was created.
Public Static Functions
-
static bool is_valid_symbol(const string &symbol)
This function does not check if any registered asset has this symbol or not; it simply checks whether the symbol would be valid.
- Returns:
true if symbol is a valid ticker symbol; false otherwise.
-
inline bool is_market_issued() const
-
class asset_publish_feeds_evaluator : public graphene::chain::evaluator<asset_publish_feeds_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_reserve_evaluator : public graphene::chain::evaluator<asset_reserve_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_settle_evaluator : public graphene::chain::evaluator<asset_settle_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_update_bitasset_evaluator : public graphene::chain::evaluator<asset_update_bitasset_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_update_evaluator : public graphene::chain::evaluator<asset_update_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_update_feed_producers_evaluator : public graphene::chain::evaluator<asset_update_feed_producers_evaluator>
- #include <asset_evaluator.hpp>
-
class asset_update_issuer_evaluator : public graphene::chain::evaluator<asset_update_issuer_evaluator>
- #include <asset_evaluator.hpp>
-
class balance_claim_evaluator : public graphene::chain::evaluator<balance_claim_evaluator>
- #include <balance_evaluator.hpp>
Public Functions
-
void_result do_apply(const balance_claim_operation &op)
Note
the fee is always 0 for this particular operation because once the balance is claimed it frees up memory and it cannot be used to spam the network
-
void_result do_apply(const balance_claim_operation &op)
-
class balance_object : public graphene::db::abstract_object<balance_object, protocol_ids, balance_object_type>
- #include <balance_object.hpp>
-
class balances_by_account_index : public graphene::db::secondary_index
- #include <account_object.hpp>
This secondary index will allow fast access to the balance objects that belonging to an account.
-
class bid_collateral_evaluator : public graphene::chain::evaluator<bid_collateral_evaluator>
- #include <market_evaluator.hpp>
-
struct bitasset_backing_asst_extractor
- #include <asset_object.hpp>
Key extractor for short backing asset.
-
class blind_transfer_evaluator : public graphene::chain::evaluator<blind_transfer_evaluator>
- #include <confidential_evaluator.hpp>
Public Functions
-
virtual void pay_fee() override
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.
-
virtual void pay_fee() override
-
class blinded_balance_object : public graphene::db::abstract_object<blinded_balance_object, implementation_ids, impl_blinded_balance_object_type>
- #include <confidential_object.hpp>
tracks a blinded balance commitment
-
class block_database
- #include <block_database.hpp>
-
class block_summary_object : public graphene::db::abstract_object<block_summary_object, implementation_ids, impl_block_summary_object_type>
- #include <block_summary_object.hpp>
tracks minimal information about past blocks to implement TaPOS
When attempting to calculate the validity of a transaction we need to lookup a past block and check its block hash and the time it occurred so we can calculate whether the current transaction is valid and at what time it should expire.
-
struct budget_record
- #include <budget_record_object.hpp>
Unnamed Group
-
share_type from_initial_reserve = 0
Sources of budget
Unnamed Group
-
share_type witness_budget = 0
Sinks of budget, should sum up to total_budget
Public Members
-
share_type requested_witness_budget = 0
Witness budget requested by the committee.
-
share_type total_budget = 0
Funds that can be released from reserve at maximum rate.
-
share_type leftover_worker_funds = 0
Unused budget.
-
share_type supply_delta = 0
Change in supply due to budget operations.
-
share_type max_supply
Maximum supply.
-
share_type current_supply
Current supply.
-
share_type from_initial_reserve = 0
-
class budget_record_object : public graphene::db::abstract_object<budget_record_object, implementation_ids, impl_budget_record_object_type>
- #include <budget_record_object.hpp>
-
struct burn_worker_type
- #include <worker_object.hpp>
A worker who permanently destroys all of his pay.
This worker sends all pay he receives to the null account.
Public Members
-
share_type total_burned
Record of how much this worker has burned in his lifetime.
-
share_type total_burned
-
class buyback_object : public graphene::db::abstract_object<buyback_object, implementation_ids, impl_buyback_object_type>
- #include <buyback_object.hpp>
buyback_authority_object only exists to help with a specific indexing problem. We want to be able to iterate over all assets that have a buyback program. However, assets which have a buyback program are very rare. So rather than indexing asset_object by the buyback field (requiring additional bookkeeping for every asset), we instead maintain a buyback_object pointing to each asset which has buyback (requiring additional bookkeeping only for every asset which has buyback).
This class is an implementation detail.
-
struct by_expiration
- #include <proposal_object.hpp>
-
class call_order_object : public graphene::db::abstract_object<call_order_object, protocol_ids, call_order_object_type>
- #include <market_object.hpp>
tracks debt and call price information
There should only be one call_order_object per asset pair per account and they will all have the same call price.
Public Functions
-
share_type get_max_debt_to_cover(price match_price, price feed_price, const uint16_t maintenance_collateral_ratio, const optional<price> &maintenance_collateralization = optional<price>()) const
Calculate maximum quantity of debt to cover to satisfy target_collateral_ratio.
- Parameters:
match_price – the matching price if this call order is margin called
feed_price – median settlement price of debt asset
maintenance_collateral_ratio – median maintenance collateral ratio of debt asset
maintenance_collateralization – maintenance collateralization of debt asset, should only be valid after core-1270 hard fork
- Returns:
maximum amount of debt that can be called
-
share_type get_max_debt_to_cover(price match_price, price feed_price, const uint16_t maintenance_collateral_ratio, const optional<price> &maintenance_collateralization = optional<price>()) const
-
class call_order_update_evaluator : public graphene::chain::evaluator<call_order_update_evaluator>
- #include <market_evaluator.hpp>
-
struct cdd_vesting_policy
- #include <vesting_balance_object.hpp>
defines vesting in terms of coin-days accrued which allows for dynamic deposit/withdraw
The economic effect of this vesting policy is to require a certain amount of “interest” to accrue before the full balance may be withdrawn. Interest accrues as coindays (balance * length held). If some of the balance is withdrawn, the remaining balance must be held longer.
Public Functions
-
fc::uint128_t compute_coin_seconds_earned(const vesting_policy_context &ctx) const
Compute coin_seconds_earned. Used to non-destructively figure out how many coin seconds are available.
-
void update_coin_seconds_earned(const vesting_policy_context &ctx)
Update coin_seconds_earned and coin_seconds_earned_last_update fields; called by both on_deposit() and on_withdraw().
Public Members
-
fc::time_point_sec start_claim
while coindays may accrue over time, none may be claimed before first_claim date
-
fc::uint128_t compute_coin_seconds_earned(const vesting_policy_context &ctx) const
-
class chain_property_object : public graphene::db::abstract_object<chain_property_object, implementation_ids, impl_chain_property_object_type>
- #include <chain_property_object.hpp>
Contains invariants which are set at genesis and never changed.
-
class collateral_bid_object : public graphene::db::abstract_object<collateral_bid_object, implementation_ids, impl_collateral_bid_object_type>
- #include <market_object.hpp>
bids of collateral for debt after a black swan
There should only be one collateral_bid_object per asset per account, and only for smartcoin assets that have a global settlement_price.
-
class committee_member_create_evaluator : public graphene::chain::evaluator<committee_member_create_evaluator>
- #include <committee_member_evaluator.hpp>
-
class committee_member_object : public graphene::db::abstract_object<committee_member_object, protocol_ids, committee_member_object_type>
- #include <committee_member_object.hpp>
tracks information about a committee_member account.
A committee_member is responsible for setting blockchain parameters and has dynamic multi-sig control over the committee account. The current set of active committee_members has control.
committee_members were separated into a separate object to make iterating over the set of committee_member easy.
-
class committee_member_update_evaluator : public graphene::chain::evaluator<committee_member_update_evaluator>
- #include <committee_member_evaluator.hpp>
-
class committee_member_update_global_parameters_evaluator : public graphene::chain::evaluator<committee_member_update_global_parameters_evaluator>
- #include <committee_member_evaluator.hpp>
-
class credit_deal_object : public graphene::db::abstract_object<credit_deal_object, protocol_ids, credit_deal_object_type>
- #include <credit_offer_object.hpp>
A credit deal describes the details of a borrower’s borrowing of funds from a credit offer.
Public Members
-
account_id_type borrower
Borrower.
-
credit_offer_id_type offer_id
ID of the credit offer.
-
account_id_type offer_owner
Owner of the credit offer, redundant info for ease of querying.
-
asset_id_type debt_asset
Asset type of the debt, redundant info for ease of querying.
-
share_type debt_amount
How much funds borrowed.
-
asset_id_type collateral_asset
Asset type of the collateral.
-
share_type collateral_amount
How much funds in collateral.
-
uint32_t fee_rate = 0
Fee rate, the demominator is GRAPHENE_FEE_RATE_DENOM.
-
time_point_sec latest_repay_time
The deadline when the debt should be repaid.
-
uint8_t auto_repay
The specified automatic repayment type.
-
account_id_type borrower
-
class credit_deal_repay_evaluator : public graphene::chain::evaluator<credit_deal_repay_evaluator>
- #include <credit_offer_evaluator.hpp>
-
class credit_deal_summary_object : public graphene::db::abstract_object<credit_deal_summary_object, implementation_ids, impl_credit_deal_summary_object_type>
- #include <credit_offer_object.hpp>
A credit deal summary describes the summary of a borrower’s borrowing of funds from a credit offer.
Public Members
-
account_id_type borrower
Borrower.
-
credit_offer_id_type offer_id
ID of the credit offer.
-
account_id_type offer_owner
Owner of the credit offer, redundant info for ease of querying.
-
asset_id_type debt_asset
Asset type of the debt, redundant info for ease of querying.
-
share_type total_debt_amount
How much funds borrowed.
-
account_id_type borrower
-
class credit_deal_update_evaluator : public graphene::chain::evaluator<credit_deal_update_evaluator>
- #include <credit_offer_evaluator.hpp>
-
class credit_offer_accept_evaluator : public graphene::chain::evaluator<credit_offer_accept_evaluator>
- #include <credit_offer_evaluator.hpp>
-
class credit_offer_create_evaluator : public graphene::chain::evaluator<credit_offer_create_evaluator>
- #include <credit_offer_evaluator.hpp>
-
class credit_offer_delete_evaluator : public graphene::chain::evaluator<credit_offer_delete_evaluator>
- #include <credit_offer_evaluator.hpp>
-
class credit_offer_object : public graphene::db::abstract_object<credit_offer_object, protocol_ids, credit_offer_object_type>
- #include <credit_offer_object.hpp>
A credit offer is a fund that can be used by other accounts who provide certain collateral.
Public Members
-
account_id_type owner_account
Owner of the fund.
-
asset_id_type asset_type
Asset type in the fund.
-
share_type total_balance
Total size of the fund.
-
share_type current_balance
Usable amount in the fund.
-
uint32_t fee_rate = 0
Fee rate, the demominator is GRAPHENE_FEE_RATE_DENOM.
-
uint32_t max_duration_seconds = 0
The time limit that borrowed funds should be repaid.
-
share_type min_deal_amount
Minimum amount to borrow for each new deal.
-
bool enabled = false
Whether this offer is available.
-
time_point_sec auto_disable_time
The time when this offer will be disabled automatically.
-
flat_map<asset_id_type, price> acceptable_collateral
Types and rates of acceptable collateral.
-
flat_map<account_id_type, share_type> acceptable_borrowers
Allowed borrowers and their maximum amounts to borrow. No limitation if empty.
-
account_id_type owner_account
-
class credit_offer_update_evaluator : public graphene::chain::evaluator<credit_offer_update_evaluator>
- #include <credit_offer_evaluator.hpp>
-
class custom_authority_create_evaluator : public graphene::chain::evaluator<custom_authority_create_evaluator>
- #include <custom_authority_evaluator.hpp>
-
class custom_authority_delete_evaluator : public graphene::chain::evaluator<custom_authority_delete_evaluator>
- #include <custom_authority_evaluator.hpp>
-
class custom_authority_object : public graphene::db::abstract_object<custom_authority_object, protocol_ids, custom_authority_object_type>
- #include <custom_authority_object.hpp>
Tracks account custom authorities.
Public Functions
-
inline bool is_valid(time_point_sec now) const
Check whether the custom authority is valid.
-
inline vector<restriction> get_restrictions() const
Get the restrictions as a vector rather than a map.
-
inline restriction_predicate_function get_predicate() const
Get predicate, from cache if possible, and update cache if not (modifies const object!)
-
inline void update_predicate_cache() const
Regenerate predicate function and update predicate cache.
-
inline void clear_predicate_cache()
Clear the cache of the predicate function.
-
inline bool is_valid(time_point_sec now) const
-
class custom_authority_update_evaluator : public graphene::chain::evaluator<custom_authority_update_evaluator>
- #include <custom_authority_evaluator.hpp>
-
class custom_evaluator : public graphene::chain::evaluator<custom_evaluator>
- #include <custom_evaluator.hpp>
-
class database : public graphene::db::object_database
- #include <database.hpp>
tracks the blockchain state in an extensible manner
Unnamed Group
-
void initialize_indexes()
Reset the object graph in-memory.
db_init.cpp ////////////////////
Unnamed Group
-
void globally_settle_asset(const asset_object &bitasset, const price &settle_price, bool check_margin_calls = false)
Globally settle
bitassetatsettle_price, let margin calls pay a premium and margin call fee ifcheck_margin_callsistrue(in this case others would be closed not atsettle_pricebut at a price better for their owners).All margin positions are force closed at the swan price Collateral received goes into a force-settlement fund No new margin positions can be created for this asset Force settlement happens without delay at the swan price, deducting from force-settlement fund
-
bool apply_order_before_hardfork_625(const limit_order_object &new_order_object)
Process a new limit order through the markets.
This function takes a new limit order, and runs the markets attempting to match it with existing orders already on the books.
- Parameters:
new_order_object – The new order to process
- Returns:
true if order was completely filled; false otherwise
Unnamed Group
-
asset calculate_market_fee(const asset_object &trade_asset, const asset &trade_amount, const bool &is_maker) const
Calculate the market fee that is to be taken.
- Parameters:
trade_asset – the asset (passed in to avoid a lookup)
trade_amount – the quantity that the fee calculation is based upon
is_maker – TRUE if this is the fee for a maker, FALSE if taker
Unnamed Group
-
std::deque<precomputable_transaction> _popped_tx
when popping a block, the transactions that were removed get cached here so they can be reapplied at the proper time
-
processed_transaction validate_transaction(const signed_transaction &trx)
This method validates transactions without adding it to the pending state.
- Returns:
true if the transaction would validate
Unnamed Group
-
void update_bitasset_current_feed(const asset_bitasset_data_object &bitasset, bool skip_median_update = false)
Derive asset_bitasset_data_object::current_feed from other data in the database
- Parameters:
bitasset – The bitasset object
skip_median_update – Whether to skip updating asset_bitasset_data_object::median_feed
Public Functions
-
void open(const fc::path &data_dir, std::function<genesis_state_type()> genesis_loader, const std::string &db_version)
Open a database, creating a new one if necessary.
Opens a database in the specified directory. If no initialized database is found, genesis_loader is called and its return value is used as the genesis state when initializing the new database
genesis_loader will not be called if an existing database is found.
- Parameters:
data_dir – Path to open or create database in
genesis_loader – A callable object which returns the genesis state to initialize new databases on
db_version – a version string that changes when the internal database format and/or logic is modified
-
void reindex(fc::path data_dir)
Rebuild object graph from block history and open detabase.
This method may be called after or instead of database::open, and will rebuild the object graph by replaying blockchain history. When this method exits successfully, the database will be open.
- Parameters:
data_dir – the path to store the database
-
void wipe(const fc::path &data_dir, bool include_blocks)
wipe Delete database from disk, and potentially the raw chain as well.
Will close the database before wiping. Database will be closed when this function returns.
- Parameters:
data_dir – the path to store the database
include_blocks – If true, delete the raw chain as well as the database.
-
witness_id_type get_scheduled_witness(uint32_t slot_num) const
Get the witness scheduled for block production in a slot.
slot_num always corresponds to a time in the future.
If slot_num == 1, returns the next scheduled witness. If slot_num == 2, returns the next scheduled witness after 1 block gap.
Use the get_slot_time() and get_slot_at_time() functions to convert between slot_num and timestamp.
Passing slot_num == 0 returns GRAPHENE_NULL_WITNESS
-
fc::time_point_sec get_slot_time(uint32_t slot_num) const
Get the time at which the given slot occurs.
If slot_num == 0, return time_point_sec().
If slot_num == N for N > 0, return the Nth next block-interval-aligned time greater than head_block_time().
-
uint32_t get_slot_at_time(fc::time_point_sec when) const
Get the last slot which occurs AT or BEFORE the given time.
The return value is the greatest value N such that get_slot_time( N ) <= when.
If no such N exists, return 0.
-
uint32_t witness_participation_rate() const
Calculate the percent of block production slots that were missed in the past 128 blocks, not including the current block.
-
vector<authority> get_viable_custom_authorities(account_id_type account, const operation &op, rejected_predicate_map *rejected_authorities = nullptr) const
Get a list of custom authorities which can validate the provided operation for the provided account.
- Parameters:
account – The account whose authority is required
op – The operation requring the specified account’s authority
rejected_authorities – [Optional] A pointer to a map that should be populated with the custom authorities which were valid, but rejected because the operation did not comply with the restrictions
- Returns:
A vector of authorities which can be used to authorize op in place of account
-
const limit_order_object *find_settled_debt_order(const asset_id_type &a) const
Find the limit order which is the individual settlement fund of the specified asset
- Parameters:
a – ID of the asset
- Returns:
nullptr if not found, pointer to the limit order if found
-
const call_order_object *find_least_collateralized_short(const asset_bitasset_data_object &bitasset, bool force_by_collateral_index) const
Find the call order with the least collateral ratio
- Parameters:
bitasset – The bitasset object
force_by_collateral_index – Whether to forcefully search via the by_collateral index
- Returns:
nullptr if not found, pointer to the call order if found
-
asset get_balance(account_id_type owner, asset_id_type asset_id) const
Retrieve a particular account’s balance in a given asset.
- Parameters:
owner – Account whose balance should be retrieved
asset_id – ID of the asset to get balance in
- Returns:
owner’s balance in asset
-
asset get_balance(const account_object &owner, const asset_object &asset_obj) const
This is an overloaded method.
-
void adjust_balance(account_id_type account, asset delta)
Adjust a particular account’s balance in a given asset by a delta.
- Parameters:
account – ID of account whose balance should be adjusted
delta – Asset ID and amount to adjust balance by
-
asset get_market_fee_vesting_balance(const account_id_type &account_id, const asset_id_type &asset_id)
Retrieve a particular account’s market fee vesting balance in a given asset.
- Parameters:
account_id – Account whose balance should be retrieved
asset_id – ID of the asset to get balance in
- Returns:
owner’s balance in asset
Helper to make lazy deposit to CDD VBO.
If the given optional VBID is not valid(), or it does not have a CDD vesting policy, or the owner / vesting_seconds of the policy does not match the parameter, then credit amount to newly created VBID and return it.
Otherwise, credit amount to ovbid.
- Returns:
ID of newly created VBO, but only if VBO was created.
helper to handle cashback rewards
helper to handle witness pay
-
void debug_dump()
This method dumps the state of the blockchain in a semi-human readable form for the purpose of tracking down funds and mismatches in currency allocation
-
void apply_force_settlement(const force_settlement_object &new_settlement, const asset_bitasset_data_object &bitasset, const asset_object &asset_obj)
Process a new force-settlement request.
Since the core-2481 hard fork, this function is called after a new force-settlement object is created to check if there are margin calls to be matched instantly.
- Parameters:
new_settlement – The new force-settlement request
bitasset – The bitasset data object
asset_obj – The asset object
-
bool check_call_orders(const asset_object &mia, bool enable_black_swan = true, bool for_new_limit_order = false, const asset_bitasset_data_object *bitasset_ptr = nullptr, bool mute_exceptions = false, bool skip_matching_settle_orders = false)
Starting with the least collateralized orders, fill them if their call price is above the max(lowest bid,call_limit).
This method will return true if it filled a short or limit
- Parameters:
mia – - the market issued asset that should be called.
enable_black_swan – - when adjusting collateral, triggering a black swan is invalid and will throw if enable_black_swan is not set to true.
for_new_limit_order – - true if this function is called when matching call orders with a new limit order. (Only relevent before hardfork 625. apply_order_before_hardfork_625() is only function that calls this with for_new_limit_order true.)
bitasset_ptr – - an optional pointer to the bitasset_data object of the asset
mute_exceptions – - whether to mute exceptions in a special case
skip_matching_settle_orders – - whether to skip matching call orders with force settlements
- Returns:
true if a margin call was executed.
-
void check_settled_debt_order(const asset_bitasset_data_object &bitasset)
Match the settled debt order of the specified asset as taker with other orders on the opposite side of the order book.
Since the core-2591 hard fork, this function is called after processed all call orders in check_call_orders().
- Parameters:
bitasset – The bitasset data object
-
bool is_known_block(const block_id_type &id) const
- Returns:
true if the block is in our fork DB or saved to disk as part of the official chain, otherwise return false
-
bool is_known_transaction(const transaction_id_type &id) const
Only return true if the transaction has not expired or been invalidated. If this method is called with a VERY old transaction we will return false, they should query things by blocks if they are that old.
-
bool push_block(const signed_block &b, uint32_t skip = skip_nothing)
Push block “may fail” in which case every partial change is unwound. After push block is successful the block is appended to the chain database on disk.
- Returns:
true if we switched forks as a result of this push.
-
processed_transaction push_transaction(const precomputable_transaction &trx, uint32_t skip = skip_nothing)
Attempts to push the transaction into the pending queue
When called to push a locally generated transaction, set the skip_block_size_check bit on the skip argument. This will allow the transaction to be pushed even if it causes the pending block size to exceed the maximum block size. Although the transaction will probably not propagate further now, as the peers are likely to have their pending queues full as well, it will be kept in the queue to be propagated later when a new block flushes out the pending queues.
-
processed_transaction push_proposal(const proposal_object &proposal)
- Throws:
fc::exception – if the proposed transaction fails to apply.
-
void pop_block()
Removes the most recent block from the database and undoes any changes it made.
-
uint32_t push_applied_operation(const operation &op, bool is_virtual = true)
This method is used to track appied operations during the evaluation of a block, these operations should include any operation actually included in a transaction as well as any implied/virtual operations that resulted, such as filling an order. The applied operations is cleared after applying each block and calling the block observers which may want to index these operations.
- Parameters:
op – The operation to push
is_virtual – Whether the operation is a virtual operation
- Returns:
the op_id which can be used to set the result after it has finished being applied.
-
fc::future<void> precompute_parallel(const signed_block &block, const uint32_t skip = skip_nothing) const
Precomputes digests, signatures and operation validations depending on skip flags. “Expensive” computations may be done in a parallel thread.
- Parameters:
block – the block to preprocess
skip – indicates which computations can be skipped
- Returns:
a future that will resolve to the input block with precomputations applied
-
fc::future<void> precompute_parallel(const precomputable_transaction &trx) const
Precomputes digests, signatures and operation validations. “Expensive” computations may be done in a parallel thread.
- Parameters:
trx – the transaction to preprocess
- Returns:
a future that will resolve to the input transaction with precomputations applied
-
processed_transaction apply_transaction(const signed_transaction &trx, uint32_t skip = skip_nothing)
Note
if a
processed_transactionis passed in, it is cast intosigned_transactionhere. It also means that theoperation_resultsfield is ignored by consensus, although it is a part of block data.
-
inline void enable_standby_votes_tracking(bool enable)
Enable or disable tracking of votes of standby witnesses and committee members.
Public Members
-
fc::signal<void(const signed_block&)> applied_block
This signal is emitted after all operations and virtual operation for a block have been applied but before the get_applied_operations() are cleared.
You may not yield from this callback because the blockchain is holding the write lock and may be in an “inconstant state” until after it is released.
-
fc::signal<void(const signed_transaction&)> on_pending_transaction
This signal is emitted any time a new transaction is added to the pending block state.
-
fc::signal<void(const vector<object_id_type>&, const flat_set<account_id_type>&)> new_objects
Emitted After a block has been applied and committed. The callback should not yield and should execute quickly.
-
fc::signal<void(const vector<object_id_type>&, const flat_set<account_id_type>&)> changed_objects
Emitted After a block has been applied and committed. The callback should not yield and should execute quickly.
-
fc::signal<void(const vector<object_id_type>&, const vector<const object*>&, const flat_set<account_id_type>&)> removed_objects
this signal is emitted any time an object is removed and contains a pointer to the last value of every object that was removed.
-
void initialize_indexes()
-
class dynamic_global_property_object : public graphene::db::abstract_object<dynamic_global_property_object, implementation_ids, impl_dynamic_global_property_object_type>
- #include <global_property_object.hpp>
Maintains global state information (committee_member list, current fees)
This is an implementation detail. The values here are calculated during normal chain operations and reflect the current values of global blockchain properties.
Public Members
-
uint32_t recently_missed_count = 0
Every time a block is missed this increases by RECENTLY_MISSED_COUNT_INCREMENT, every time a block is found it decreases by RECENTLY_MISSED_COUNT_DECREMENT. It is never less than 0.
-
uint64_t current_aslot = 0
The current absolute slot number. Equal to the total number of slots since genesis. Also equal to the total number of missed slots plus head_block_number.
-
fc::uint128_t recent_slots_filled
used to compute witness participation.
-
uint32_t dynamic_flags = 0
dynamic_flags specifies chain state properties that can be expressed in one bit.
-
uint32_t recently_missed_count = 0
-
template<typename DerivedEvaluator>
class evaluator : public graphene::chain::generic_evaluator - #include <evaluator.hpp>
Public Functions
-
inline virtual operation_result evaluate(const operation &o) final override
Note
derived classes should ASSUME that the default validation that is indepenent of chain state should be performed by op.validate() and should not perform these extra checks.
-
inline virtual operation_result evaluate(const operation &o) final override
-
class fba_accumulator_object : public graphene::db::abstract_object<fba_accumulator_object, implementation_ids, impl_fba_accumulator_object_type>
- #include <fba_object.hpp>
fba_accumulator_object accumulates fees to be paid out via buyback or other FBA mechanism.
-
class force_settlement_object : public graphene::db::abstract_object<force_settlement_object, protocol_ids, force_settlement_object_type>
- #include <market_object.hpp>
tracks bitassets scheduled for force settlement at some point in the future.
On the settlement_date the balance will be converted to the collateral asset and paid to owner and then this object will be deleted.
-
class fork_database
- #include <fork_database.hpp>
As long as blocks are pushed in order the fork database will maintain a linked tree of all blocks that branch from the start_block. The tree will have a maximum depth of 1024 blocks after which the database will start lopping off forks.
Every time a block is pushed into the fork DB the block with the highest block_num will be returned.
Public Functions
-
shared_ptr<fork_item> push_block(const signed_block &b)
Pushes the block into the fork database
- Returns:
the new head block ( the longest fork )
-
pair<branch_type, branch_type> fetch_branch_from(block_id_type first, block_id_type second) const
Given two head blocks, return two branches of the fork graph that end with a common ancestor (same prior block)
Public Static Attributes
-
static const int MAX_BLOCK_REORDERING = 1024
The maximum number of blocks that may be skipped in an out-of-order push.
-
shared_ptr<fork_item> push_block(const signed_block &b)
-
struct fork_item
- #include <fork_database.hpp>
-
class generic_evaluator
- #include <evaluator.hpp>
Subclassed by graphene::chain::evaluator< account_create_evaluator >, graphene::chain::evaluator< account_update_evaluator >, graphene::chain::evaluator< account_upgrade_evaluator >, graphene::chain::evaluator< account_whitelist_evaluator >, graphene::chain::evaluator< assert_evaluator >, graphene::chain::evaluator< asset_claim_fees_evaluator >, graphene::chain::evaluator< asset_claim_pool_evaluator >, graphene::chain::evaluator< asset_create_evaluator >, graphene::chain::evaluator< asset_fund_fee_pool_evaluator >, graphene::chain::evaluator< asset_global_settle_evaluator >, graphene::chain::evaluator< asset_issue_evaluator >, graphene::chain::evaluator< asset_publish_feeds_evaluator >, graphene::chain::evaluator< asset_reserve_evaluator >, graphene::chain::evaluator< asset_settle_evaluator >, graphene::chain::evaluator< asset_update_bitasset_evaluator >, graphene::chain::evaluator< asset_update_evaluator >, graphene::chain::evaluator< asset_update_feed_producers_evaluator >, graphene::chain::evaluator< asset_update_issuer_evaluator >, graphene::chain::evaluator< balance_claim_evaluator >, graphene::chain::evaluator< bid_collateral_evaluator >, graphene::chain::evaluator< blind_transfer_evaluator >, graphene::chain::evaluator< call_order_update_evaluator >, graphene::chain::evaluator< committee_member_create_evaluator >, graphene::chain::evaluator< committee_member_update_evaluator >, graphene::chain::evaluator< committee_member_update_global_parameters_evaluator >, graphene::chain::evaluator< credit_deal_repay_evaluator >, graphene::chain::evaluator< credit_deal_update_evaluator >, graphene::chain::evaluator< credit_offer_accept_evaluator >, graphene::chain::evaluator< credit_offer_create_evaluator >, graphene::chain::evaluator< credit_offer_delete_evaluator >, graphene::chain::evaluator< credit_offer_update_evaluator >, graphene::chain::evaluator< custom_authority_create_evaluator >, graphene::chain::evaluator< custom_authority_delete_evaluator >, graphene::chain::evaluator< custom_authority_update_evaluator >, graphene::chain::evaluator< custom_evaluator >, graphene::chain::evaluator< htlc_create_evaluator >, graphene::chain::evaluator< htlc_extend_evaluator >, graphene::chain::evaluator< htlc_redeem_evaluator >, graphene::chain::evaluator< limit_order_cancel_evaluator >, graphene::chain::evaluator< limit_order_create_evaluator >, graphene::chain::evaluator< limit_order_update_evaluator >, graphene::chain::evaluator< liquidity_pool_create_evaluator >, graphene::chain::evaluator< liquidity_pool_delete_evaluator >, graphene::chain::evaluator< liquidity_pool_deposit_evaluator >, graphene::chain::evaluator< liquidity_pool_exchange_evaluator >, graphene::chain::evaluator< liquidity_pool_update_evaluator >, graphene::chain::evaluator< liquidity_pool_withdraw_evaluator >, graphene::chain::evaluator< override_transfer_evaluator >, graphene::chain::evaluator< proposal_create_evaluator >, graphene::chain::evaluator< proposal_delete_evaluator >, graphene::chain::evaluator< proposal_update_evaluator >, graphene::chain::evaluator< samet_fund_borrow_evaluator >, graphene::chain::evaluator< samet_fund_create_evaluator >, graphene::chain::evaluator< samet_fund_delete_evaluator >, graphene::chain::evaluator< samet_fund_repay_evaluator >, graphene::chain::evaluator< samet_fund_update_evaluator >, graphene::chain::evaluator< ticket_create_evaluator >, graphene::chain::evaluator< ticket_update_evaluator >, graphene::chain::evaluator< transfer_evaluator >, graphene::chain::evaluator< transfer_from_blind_evaluator >, graphene::chain::evaluator< transfer_to_blind_evaluator >, graphene::chain::evaluator< vesting_balance_create_evaluator >, graphene::chain::evaluator< vesting_balance_withdraw_evaluator >, graphene::chain::evaluator< withdraw_permission_claim_evaluator >, graphene::chain::evaluator< withdraw_permission_create_evaluator >, graphene::chain::evaluator< withdraw_permission_delete_evaluator >, graphene::chain::evaluator< withdraw_permission_update_evaluator >, graphene::chain::evaluator< witness_create_evaluator >, graphene::chain::evaluator< witness_update_evaluator >, graphene::chain::evaluator< worker_create_evaluator >, graphene::chain::evaluator< DerivedEvaluator >
Public Functions
-
virtual operation_result evaluate(const operation &op) = 0
Note
derived classes should ASSUME that the default validation that is indepenent of chain state should be performed by op.validate() and should not perform these extra checks.
-
virtual void pay_fee()
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.
-
virtual operation_result evaluate(const operation &op) = 0
-
struct genesis_state_type
- #include <genesis_state.hpp>
Public Functions
-
chain_id_type compute_chain_id() const
Get the chain_id corresponding to this genesis state.
This is the SHA256 serialization of the genesis_state.
-
void override_witness_signing_keys(const std::string &new_key)
Method to override initial witness signing keys for debug.
Public Members
-
chain_id_type initial_chain_id
Temporary, will be moved elsewhere.
-
struct initial_account_type
- #include <genesis_state.hpp>
-
struct initial_asset_type
- #include <genesis_state.hpp>
-
struct initial_collateral_position
- #include <genesis_state.hpp>
-
struct initial_collateral_position
-
struct initial_balance_type
- #include <genesis_state.hpp>
-
struct initial_committee_member_type
- #include <genesis_state.hpp>
Public Members
-
string owner_name
Must correspond to one of the initial accounts.
-
string owner_name
-
struct initial_vesting_balance_type
- #include <genesis_state.hpp>
-
chain_id_type compute_chain_id() const
-
class global_property_object : public graphene::db::abstract_object<global_property_object, implementation_ids, impl_global_property_object_type>
- #include <global_property_object.hpp>
Maintains global state information (committee_member list, current fees)
This is an implementation detail. The values here are set by committee_members to tune the blockchain parameters.
-
struct hardfork_visitor
- #include <hardfork_visitor.hpp>
The hardfork_visitor struct checks whether a given operation type has been hardforked in or not.
This visitor can be invoked in several different ways, including operation::visit, typelist::runtime::dispatch, or direct invocation by calling the visit() method passing an operation variant, narrow operation type, operation tag, or templating on the narrow operation type
Public Functions
-
inline explicit hardfork_visitor(const fc::time_point_sec &head_block_time)
Note
using head block time for all operations
-
inline explicit hardfork_visitor(const fc::time_point_sec &head_block_time)
-
class hardfork_visitor_1479
- #include <proposal_evaluator.hpp>
-
struct hardfork_visitor_214
-
class htlc_create_evaluator : public graphene::chain::evaluator<htlc_create_evaluator>
- #include <htlc_evaluator.hpp>
-
class htlc_extend_evaluator : public graphene::chain::evaluator<htlc_extend_evaluator>
- #include <htlc_evaluator.hpp>
-
class htlc_object : public graphene::db::abstract_object<htlc_object, protocol_ids, htlc_object_type>
- #include <htlc_object.hpp>
database object to store HTLCs
This object is stored in the database while an HTLC is active. The HTLC will become inactive at expiration or when unlocked via the preimage.
-
struct condition_info
- #include <htlc_object.hpp>
-
struct hash_lock_info
- #include <htlc_object.hpp>
-
struct time_lock_info
- #include <htlc_object.hpp>
-
struct hash_lock_info
-
struct from_extractor
- #include <htlc_object.hpp>
-
struct timelock_extractor
- #include <htlc_object.hpp>
-
struct to_extractor
- #include <htlc_object.hpp>
-
struct transfer_info
- #include <htlc_object.hpp>
-
struct condition_info
-
class htlc_redeem_evaluator : public graphene::chain::evaluator<htlc_redeem_evaluator>
- #include <htlc_evaluator.hpp>
-
class htlc_redeem_visitor
-
struct immutable_chain_parameters
- #include <immutable_chain_parameters.hpp>
-
struct index_entry
-
struct init_policy_visitor
-
struct instant_vesting_policy
- #include <vesting_balance_object.hpp>
instant vesting policy
This policy allows to withdraw everything that is on a balance immediately
-
class limit_order_cancel_evaluator : public graphene::chain::evaluator<limit_order_cancel_evaluator>
- #include <market_evaluator.hpp>
-
class limit_order_create_evaluator : public graphene::chain::evaluator<limit_order_create_evaluator>
- #include <market_evaluator.hpp>
Public Functions
-
virtual void convert_fee() override
override the default behavior defined by generic_evaluator
-
virtual void pay_fee() override
override the default behavior defined by generic_evaluator which is to post the fee to fee_paying_account_stats.pending_fees
-
virtual void convert_fee() override
-
class limit_order_object : public graphene::db::abstract_object<limit_order_object, protocol_ids, limit_order_object_type>
- #include <market_object.hpp>
an offer to sell an amount of an asset at a specified exchange rate by a certain time
The objects are indexed by expiration and are automatically deleted on the first block after expiration.
Public Functions
-
inline const create_take_profit_order_action &get_take_profit_action() const
Returns the configured automatic action that will create a take profit order when this limit order is filled.
Public Members
-
time_point_sec expiration
When this limit order will expire.
-
account_id_type seller
Who is selling.
-
share_type for_sale
The amount for sale, asset id is sell_price.base.asset_id.
-
price sell_price
The seller’s asking price.
-
fc::uint128_t filled_amount = 0
The amount that has been sold, asset id is sell_price.base.asset_id.
-
share_type deferred_fee
fee converted to CORE
-
asset deferred_paid_fee
originally paid fee
-
bool is_settled_debt = false
Whether this order is an individual settlement fund.
-
vector<limit_order_auto_action> on_fill
Automatic actions when the limit order is filled or partially filled.
-
optional<limit_order_id_type> take_profit_order_id
ID of the take profit limit order linked to this limit order.
-
inline const create_take_profit_order_action &get_take_profit_action() const
-
class limit_order_update_evaluator : public graphene::chain::evaluator<limit_order_update_evaluator>
- #include <market_evaluator.hpp>
Public Functions
-
virtual void convert_fee() override
override the default behavior defined by generic_evaluator
-
virtual void pay_fee() override
override the default behavior defined by generic_evaluator which is to post the fee to fee_paying_account_stats.pending_fees
-
virtual void convert_fee() override
-
struct linear_vesting_policy
- #include <vesting_balance_object.hpp>
Linear vesting balance with cliff.
This vesting balance type is used to mimic traditional stock vesting contracts where each day a certain amount vests until it is fully matured.
Note
New funds may not be added to a linear vesting balance.
Public Members
-
fc::time_point_sec begin_timestamp
This is the time at which funds begin vesting.
-
uint32_t vesting_cliff_seconds = 0
No amount may be withdrawn before this many seconds of the vesting period have elapsed.
-
uint32_t vesting_duration_seconds = 0
Duration of the vesting period, in seconds. Must be greater than 0 and greater than vesting_cliff_seconds.
-
share_type begin_balance
The total amount of asset to vest.
-
fc::time_point_sec begin_timestamp
-
class liquidity_pool_create_evaluator : public graphene::chain::evaluator<liquidity_pool_create_evaluator>
- #include <liquidity_pool_evaluator.hpp>
-
class liquidity_pool_delete_evaluator : public graphene::chain::evaluator<liquidity_pool_delete_evaluator>
- #include <liquidity_pool_evaluator.hpp>
-
class liquidity_pool_deposit_evaluator : public graphene::chain::evaluator<liquidity_pool_deposit_evaluator>
- #include <liquidity_pool_evaluator.hpp>
-
class liquidity_pool_exchange_evaluator : public graphene::chain::evaluator<liquidity_pool_exchange_evaluator>
- #include <liquidity_pool_evaluator.hpp>
-
class liquidity_pool_object : public graphene::db::abstract_object<liquidity_pool_object, protocol_ids, liquidity_pool_object_type>
- #include <liquidity_pool_object.hpp>
A liquidity pool.
Subclassed by graphene::app::extended_liquidity_pool_object
Public Members
-
asset_id_type asset_a
Type of the first asset in the pool.
-
asset_id_type asset_b
Type of the second asset in the pool.
-
share_type balance_a
The balance of the first asset in the pool.
-
share_type balance_b
The balance of the second asset in the pool.
Type of the share asset aka the LP token.
-
uint16_t taker_fee_percent = 0
Taker fee percent.
-
uint16_t withdrawal_fee_percent = 0
Withdrawal fee percent.
-
fc::uint128_t virtual_value = 0
Virtual value of the pool.
-
asset_id_type asset_a
-
class liquidity_pool_update_evaluator : public graphene::chain::evaluator<liquidity_pool_update_evaluator>
- #include <liquidity_pool_evaluator.hpp>
-
class liquidity_pool_withdraw_evaluator : public graphene::chain::evaluator<liquidity_pool_withdraw_evaluator>
- #include <liquidity_pool_evaluator.hpp>
-
class node_property_object
- #include <node_property_object.hpp>
Contains per-node database configuration.
Transactions are evaluated differently based on per-node state. Settings here may change based on whether the node is syncing or up-to-date. Or whether the node is a witness node. Or if we’re processing a transaction in a witness-signed block vs. a fresh transaction from the p2p network. Or configuration-specified tradeoffs of performance/hardfork resilience vs. paranoia.
-
class op_evaluator
- #include <evaluator.hpp>
Subclassed by graphene::chain::op_evaluator_impl< T >
-
template<typename T>
class op_evaluator_impl : public graphene::chain::op_evaluator - #include <evaluator.hpp>
-
class operation_history_object : public graphene::db::abstract_object<operation_history_object, protocol_ids, operation_history_object_type>
- #include <operation_history_object.hpp>
tracks the history of all logical operations on blockchain state
All operations and virtual operations result in the creation of an operation_history_object that is maintained on disk as a stack. Each real or virtual operation is assigned a unique ID / sequence number that it can be referenced by.
Note
by default these objects are not tracked, the account_history_plugin must be loaded fore these objects to be maintained.
Note
this object is READ ONLY it can never be modified
Public Members
-
uint32_t block_num = 0
the block that caused this operation
-
uint16_t trx_in_block = 0
the transaction in the block
-
uint16_t op_in_trx = 0
the operation within the transaction
-
uint32_t virtual_op = 0
any virtual operations implied by operation in block
-
bool is_virtual = false
Whether this is a virtual operation
-
time_point_sec block_time
The timestamp of the block that caused this operation
-
uint32_t block_num = 0
-
class override_transfer_evaluator : public graphene::chain::evaluator<override_transfer_evaluator>
- #include <transfer_evaluator.hpp>
-
struct predicate_evaluator
-
struct price_feed_with_icr : public graphene::protocol::price_feed
- #include <asset_object.hpp>
defines market parameters for margin positions, extended with an initial_collateral_ratio field
Public Functions
-
price get_initial_collateralization() const
The result will be used to check new debt positions and position updates. Calculation: ~settlement_price * initial_collateral_ratio / GRAPHENE_COLLATERAL_RATIO_DENOM
Public Members
-
uint16_t initial_collateral_ratio = GRAPHENE_DEFAULT_MAINTENANCE_COLLATERAL_RATIO
After BSIP77, when creating a new debt position or updating an existing position, the position will be checked against this parameter. Fixed point between 1.000 and 10.000, implied fixed point denominator is GRAPHENE_COLLATERAL_RATIO_DENOM
-
price get_initial_collateralization() const
-
class proposal_create_evaluator : public graphene::chain::evaluator<proposal_create_evaluator>
- #include <proposal_evaluator.hpp>
-
class proposal_delete_evaluator : public graphene::chain::evaluator<proposal_delete_evaluator>
- #include <proposal_evaluator.hpp>
-
class proposal_object : public graphene::db::abstract_object<proposal_object, protocol_ids, proposal_object_type>
- #include <proposal_object.hpp>
tracks the approval of a partially approved transaction
-
struct proposal_operation_hardfork_visitor
-
class proposal_update_evaluator : public graphene::chain::evaluator<proposal_update_evaluator>
- #include <proposal_evaluator.hpp>
-
struct refund_worker_type
- #include <worker_object.hpp>
A worker who returns all of his pay to the reserve.
This worker type pays everything he receives back to the network’s reserve funds pool.
Public Members
-
share_type total_burned
Record of how much this worker has burned in his lifetime.
-
share_type total_burned
-
class required_approval_index : public graphene::db::secondary_index
- #include <proposal_object.hpp>
tracks all of the proposal objects that requrie approval of an individual account.
This is a secondary index on the proposal_index
Note
the set of required approvals is constant
-
class samet_fund_borrow_evaluator : public graphene::chain::evaluator<samet_fund_borrow_evaluator>
- #include <samet_fund_evaluator.hpp>
-
class samet_fund_create_evaluator : public graphene::chain::evaluator<samet_fund_create_evaluator>
- #include <samet_fund_evaluator.hpp>
-
class samet_fund_delete_evaluator : public graphene::chain::evaluator<samet_fund_delete_evaluator>
- #include <samet_fund_evaluator.hpp>
-
class samet_fund_object : public graphene::db::abstract_object<samet_fund_object, protocol_ids, samet_fund_object_type>
- #include <samet_fund_object.hpp>
A SameT Fund is a fund which can be used by a borrower and have to be repaid in the same transaction.
-
class samet_fund_repay_evaluator : public graphene::chain::evaluator<samet_fund_repay_evaluator>
- #include <samet_fund_evaluator.hpp>
-
class samet_fund_update_evaluator : public graphene::chain::evaluator<samet_fund_update_evaluator>
- #include <samet_fund_evaluator.hpp>
-
struct special_authority_evaluate_visitor
-
class special_authority_object : public graphene::db::abstract_object<special_authority_object, implementation_ids, impl_special_authority_object_type>
- #include <special_authority_object.hpp>
special_authority_object only exists to help with a specific indexing problem. We want to be able to iterate over all accounts that contain a special authority. However, accounts which have a special_authority are very rare. So rather than indexing account_object by the special_authority fields (requiring additional bookkeeping for every account), we instead maintain a special_authority_object pointing to each account which has special_authority (requiring additional bookkeeping only for every account which has special_authority).
This class is an implementation detail.
-
class ticket_create_evaluator : public graphene::chain::evaluator<ticket_create_evaluator>
- #include <ticket_evaluator.hpp>
-
class ticket_object : public graphene::db::abstract_object<ticket_object, protocol_ids, ticket_object_type>
- #include <ticket_object.hpp>
a ticket for governance voting
Public Functions
-
void init_new(time_point_sec now, account_id_type new_account, ticket_type new_target_type, const asset &new_amount, ticket_version version)
Initialize member variables for a ticket newly created from account balance.
-
void init_split(time_point_sec now, const ticket_object &old_ticket, ticket_type new_target_type, const asset &new_amount, ticket_version version)
Initialize member variables for a ticket split from another ticket.
-
void update_target_type(time_point_sec now, ticket_type new_target_type, ticket_version version)
Set a new target type and update member variables accordingly.
-
void adjust_amount(const asset &delta_amount, ticket_version version)
Adjust amount and update member variables accordingly.
-
void auto_update(ticket_version version)
Update the ticket when it’s time.
Public Members
-
account_id_type account
The account who owns the ticket.
-
ticket_type target_type
The target type of the ticket.
-
asset amount
The token type and amount in the ticket.
-
ticket_type current_type
The current type of the ticket.
-
ticket_status status
The status of the ticket.
-
share_type value
The current value of the ticket.
-
time_point_sec next_auto_update_time
The next time that the ticket will be automatically updated.
-
time_point_sec next_type_downgrade_time = time_point_sec::maximum()
When the account has ever started a downgrade or withdrawal, the scheduled auto-update time is stored here.
-
void init_new(time_point_sec now, account_id_type new_account, ticket_type new_target_type, const asset &new_amount, ticket_version version)
-
class ticket_update_evaluator : public graphene::chain::evaluator<ticket_update_evaluator>
- #include <ticket_evaluator.hpp>
-
class transaction_evaluation_state
- #include <transaction_evaluation_state.hpp>
Place holder for state tracked while processing a transaction. This class provides helper methods that are common to many different operations and also tracks which keys have signed the transaction
-
class transaction_history_object : public graphene::db::abstract_object<transaction_history_object, implementation_ids, impl_transaction_history_object_type>
- #include <transaction_history_object.hpp>
The purpose of this object is to enable the detection of duplicate transactions. When a transaction is included in a block a transaction_history_object is added. At the end of block processing all transaction_history_objects that have expired can be removed from the index.
-
class transfer_evaluator : public graphene::chain::evaluator<transfer_evaluator>
- #include <transfer_evaluator.hpp>
-
class transfer_from_blind_evaluator : public graphene::chain::evaluator<transfer_from_blind_evaluator>
- #include <confidential_evaluator.hpp>
Public Functions
-
virtual void pay_fee() override
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.
-
virtual void pay_fee() override
-
class transfer_to_blind_evaluator : public graphene::chain::evaluator<transfer_to_blind_evaluator>
- #include <confidential_evaluator.hpp>
Public Functions
-
virtual void pay_fee() override
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.
-
virtual void pay_fee() override
-
class undo_session_nesting_guard
-
class vesting_balance_create_evaluator : public graphene::chain::evaluator<vesting_balance_create_evaluator>
- #include <vesting_balance_evaluator.hpp>
-
class vesting_balance_object : public graphene::db::abstract_object<vesting_balance_object, protocol_ids, vesting_balance_object_type>
- #include <vesting_balance_object.hpp>
Vesting balance object is a balance that is locked by the blockchain for a period of time.
Subclassed by graphene::wallet::vesting_balance_object_with_info
Public Functions
-
void deposit(const fc::time_point_sec &now, const asset &amount)
Deposit amount into vesting balance, requiring it to vest before withdrawal.
-
void deposit_vested(const fc::time_point_sec &now, const asset &amount)
Deposit amount into vesting balance, making the new funds vest immediately.
-
void withdraw(const fc::time_point_sec &now, const asset &amount)
Used to remove a vesting balance from the VBO. As well as the balance field, coin_seconds_earned and coin_seconds_earned_last_update fields are updated.
The money doesn’t “go” anywhere; the caller is responsible for crediting it to the proper account.
-
asset get_allowed_withdraw(const time_point_sec &now) const
Get amount of allowed withdrawal.
Public Members
-
account_id_type owner
Account which owns and may withdraw from this vesting balance.
-
asset balance
Total amount remaining in this vesting balance Includes the unvested funds, and the vested funds which have not yet been withdrawn
-
vesting_policy policy
The vesting policy stores details on when funds vest, and controls when they may be withdrawn.
-
vesting_balance_type balance_type = vesting_balance_type::unspecified
type of the vesting balance
-
void deposit(const fc::time_point_sec &now, const asset &amount)
-
class vesting_balance_withdraw_evaluator : public graphene::chain::evaluator<vesting_balance_withdraw_evaluator>
- #include <vesting_balance_evaluator.hpp>
-
struct vesting_balance_worker_type
- #include <worker_object.hpp>
A worker who sends his pay to a vesting balance.
This worker type takes all of his pay and places it into a vesting balance
Public Members
-
vesting_balance_id_type balance
The balance this worker pays into.
-
vesting_balance_id_type balance
-
struct vesting_policy_context
- #include <vesting_balance_object.hpp>
-
struct vote_counter
- #include <vote_count.hpp>
Keep track of vote totals in internal authority object. See #533.
Public Functions
-
inline void finish(authority &out_auth)
Write into out_auth, but only if we have at least one member.
-
inline void finish(authority &out_auth)
-
class withdraw_permission_claim_evaluator : public graphene::chain::evaluator<withdraw_permission_claim_evaluator>
- #include <withdraw_permission_evaluator.hpp>
-
class withdraw_permission_create_evaluator : public graphene::chain::evaluator<withdraw_permission_create_evaluator>
- #include <withdraw_permission_evaluator.hpp>
-
class withdraw_permission_delete_evaluator : public graphene::chain::evaluator<withdraw_permission_delete_evaluator>
- #include <withdraw_permission_evaluator.hpp>
-
class withdraw_permission_object : public graphene::db::abstract_object<withdraw_permission_object, protocol_ids, withdraw_permission_object_type>
- #include <withdraw_permission_object.hpp>
Grants another account authority to withdraw a limited amount of funds per interval.
The primary purpose of this object is to enable recurring payments on the blockchain. An account which wishes to process a recurring payment may use a graphene::protocol::withdraw_permission_claim_operation to reference an object of this type and withdraw up to withdrawal_limit from withdraw_from_account. Only authorized_account may do this. Any number of withdrawals may be made so long as the total amount withdrawn per period does not exceed the limit for any given period.
Public Members
-
account_id_type withdraw_from_account
The account authorizing authorized_account to withdraw from it.
-
account_id_type authorized_account
The account authorized to make withdrawals from withdraw_from_account.
-
asset withdrawal_limit
The maximum amount which may be withdrawn per period. All withdrawals must be of this asset type.
-
uint32_t withdrawal_period_sec = 0
The duration of a withdrawal period in seconds.
-
time_point_sec period_start_time
The beginning of the next withdrawal period. WARNING: Due to caching, this value does not always represent the start of the next or current period, because it is only updated after a withdrawal operation such as claim. For the latest current period, use current_period().
-
time_point_sec expiration
The time at which this withdraw permission expires.
-
share_type claimed_this_period
Tracks the total amount WARNING: Due to caching, this value does not always represent the total amount claimed during the current period, it may represent what was claimed during the last claimed period, because it is only updated after a withdrawal operation such as claim. For the latest current period, use current_period().
-
account_id_type withdraw_from_account
-
class withdraw_permission_update_evaluator : public graphene::chain::evaluator<withdraw_permission_update_evaluator>
- #include <withdraw_permission_evaluator.hpp>
-
class witness_create_evaluator : public graphene::chain::evaluator<witness_create_evaluator>
- #include <witness_evaluator.hpp>
-
class witness_object : public graphene::db::abstract_object<witness_object, protocol_ids, witness_object_type>
- #include <witness_object.hpp>
-
class witness_schedule_object : public graphene::db::abstract_object<witness_schedule_object, implementation_ids, impl_witness_schedule_object_type>
- #include <witness_schedule_object.hpp>
-
class witness_update_evaluator : public graphene::chain::evaluator<witness_update_evaluator>
- #include <witness_evaluator.hpp>
-
class worker_create_evaluator : public graphene::chain::evaluator<worker_create_evaluator>
- #include <worker_evaluator.hpp>
-
struct worker_init_visitor
-
class worker_object : public graphene::db::abstract_object<worker_object, protocol_ids, worker_object_type>
- #include <worker_object.hpp>
Worker object contains the details of a blockchain worker. See The Blockchain Worker System for details.
Public Members
-
account_id_type worker_account
ID of the account which owns this worker.
-
time_point_sec work_begin_date
Time at which this worker begins receiving pay, if elected.
-
time_point_sec work_end_date
Time at which this worker will cease to receive pay. Worker will be deleted at this time.
-
share_type daily_pay
Amount in CORE this worker will be paid each day.
-
worker_type worker
ID of this worker’s pay balance.
-
string name
Human-readable name for the worker.
-
string url
URL to a web page representing this worker.
-
vote_id_type vote_for
Voting ID which represents approval of this worker.
-
vote_id_type vote_against
Voting ID which represents disapproval of this worker.
-
account_id_type worker_account
-
struct worker_pay_visitor
A visitor for worker_type which calls pay_worker on the worker within.
-
namespace detail
Functions
-
void check_asset_options_hf_1774(const fc::time_point_sec &block_time, const asset_options &options)
-
void check_bitasset_options_hf_bsip74(const fc::time_point_sec &block_time, const bitasset_options &options)
-
void check_asset_options_hf_bsip81(const fc::time_point_sec &block_time, const asset_options &options)
-
void check_asset_options_hf_bsip_48_75(const fc::time_point_sec &block_time, const asset_options &options)
-
void check_bitasset_options_hf_bsip_48_75(const fc::time_point_sec &block_time, const bitasset_options &options)
-
void check_asset_update_extensions_hf_bsip_48_75(const fc::time_point_sec &block_time, const asset_update_operation::ext &extensions)
-
void check_asset_publish_feed_extensions_hf_bsip77(const fc::time_point_sec &block_time, const asset_publish_feed_operation::ext &extensions)
-
void check_bitasset_options_hf_bsip77(const fc::time_point_sec &block_time, const bitasset_options &options)
-
void check_bitasset_options_hf_bsip87(const fc::time_point_sec &block_time, const bitasset_options &options)
-
void check_asset_claim_fees_hardfork_87_74_collatfee(const fc::time_point_sec &block_time, const asset_claim_fees_operation &op)
-
void check_asset_options_hf_core2281(const fc::time_point_sec &next_maint_time, const asset_options &options)
-
void check_asset_options_hf_core2467(const fc::time_point_sec &next_maint_time, const asset_options &options)
-
void check_bitasset_opts_hf_core2467(const fc::time_point_sec &next_maint_time, const bitasset_options &options)
-
void check_htlc_create_hf_bsip64(const fc::time_point_sec &block_time, const htlc_create_operation &op, const asset_object &asset_to_transfer)
-
void check_htlc_redeem_hf_bsip64(const fc::time_point_sec &block_time, const htlc_redeem_operation &op, const htlc_object *htlc_obj)
-
template<typename Lambda>
void with_skip_flags(database &db, uint32_t skip_flags, Lambda callback) Set the skip_flags to the given value, call callback, then reset skip_flags to their previous value after callback is done.
-
template<typename Lambda>
void without_pending_transactions(database &db, std::vector<processed_transaction> &&pending_transactions, Lambda callback) Empty pending_transactions, call callback, then reset pending_transactions after callback is done.
Pending transactions which no longer validate will be culled.
-
bool _is_authorized_asset(const database &d, const account_object &acct, const asset_object &asset_obj)
-
inline uint64_t vbo_mfs_hash(const account_id_type &account_id, const asset_id_type &asset_id)
Calculate a hash for account_id_type and asset_id. Use 48 bit value (see object_id.hpp) for account_id and XOR it with 24 bit for asset_id
-
struct get_impacted_account_visitor
-
struct pending_transactions_restorer
- #include <db_with.hpp>
Class used to help the without_pending_transactions implementation.
TODO: Change the name of this class to better reflect the fact that it restores popped transactions as well as pending transactions.
-
struct skip_flags_restorer
- #include <db_with.hpp>
Class used to help the with_skip_flags implementation. It must be defined in this header because it must be available to the with_skip_flags implementation, which is a template and therefore must also be defined in this header.
-
struct vbo_mfs_key
Used as a key to search vesting_balance_object in the index
-
struct vesting_balance_object_equal
- #include <vesting_balance_object.hpp>
Used as CompatiblePred Compares two vesting_balance_objects if vesting_balance_object.balance_type is a market_fee_sharing compare owners’ ids and assets’ ids otherwise: vesting_balance_object.id
-
struct vesting_balance_object_hash
- #include <vesting_balance_object.hpp>
Used as CompatibleHash Calculate a hash vesting_balance_object if vesting_balance_object.balance_type is market_fee_sharing calculate has as vbo_mfs_hash(vesting_balance_object.owner, hash(vbo.balance.asset_id) (see vbo_mfs_hash) otherwise: hash_value(vesting_balance_object.id);
-
struct vote_recalc_options
-
struct vote_recalc_times
-
void check_asset_options_hf_1774(const fc::time_point_sec &block_time, const asset_options &options)
-
typedef multi_index_container<account_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_maintenance_flag>, member<account_balance_object, bool, &account_balance_object::maintenance_flag>>, ordered_unique<tag<by_asset_balance>, composite_key<account_balance_object, member<account_balance_object, asset_id_type, &account_balance_object::asset_type>, member<account_balance_object, share_type, &account_balance_object::balance>, member<account_balance_object, account_id_type, &account_balance_object::owner>>, composite_key_compare<std::less<asset_id_type>, std::greater<share_type>, std::less<account_id_type>>>>> account_balance_object_multi_index_type