25 #include <graphene/chain/hardfork.hpp> 28 namespace graphene {
namespace chain {
namespace detail {
37 : _impacted( impact ), _ignore_custom_op_reqd_auths( ignore_custom_op_required_auths )
44 _impacted.insert( op.
to );
166 vector<authority> other;
169 _ignore_custom_op_reqd_auths );
170 for(
const auto& o : other )
216 _impacted.insert( op.
owner );
229 if( !_ignore_custom_op_reqd_auths )
242 _impacted.insert( op.
to );
243 _impacted.insert( op.
from );
249 for(
const auto& out : op.
outputs )
255 for(
const auto& in : op.
inputs )
257 for(
const auto& out : op.
outputs )
263 _impacted.insert( op.
to );
264 for(
const auto& in : op.
inputs )
278 _impacted.insert( op.
to );
286 _impacted.insert( op.
from );
288 _impacted.insert( op.
to );
392 bool ignore_custom_op_required_auths )
400 bool ignore_custom_op_required_auths )
406 static void get_relevant_accounts(
const object* obj, flat_set<account_id_type>& accounts,
407 bool ignore_custom_op_required_auths ) {
408 FC_ASSERT( obj !=
nullptr,
"Internal error: get_relevant_accounts called with nullptr" );
411 switch( (object_type)obj->
id.
type() )
413 case null_object_type:
414 case base_object_type:
416 case account_object_type:
417 accounts.insert( account_id_type(obj->
id) );
419 case asset_object_type:{
420 const auto* aobj =
dynamic_cast<const asset_object*
>(obj);
421 accounts.insert( aobj->issuer );
423 }
case force_settlement_object_type:{
425 accounts.insert( aobj->owner );
427 }
case committee_member_object_type:{
429 accounts.insert( aobj->committee_member_account );
431 }
case witness_object_type:{
433 accounts.insert( aobj->witness_account );
435 }
case limit_order_object_type:{
437 accounts.insert( aobj->seller );
439 }
case call_order_object_type:{
441 accounts.insert( aobj->borrower );
443 }
case custom_object_type:
445 case proposal_object_type:{
448 ignore_custom_op_required_auths );
450 }
case operation_history_object_type:{
453 ignore_custom_op_required_auths );
455 }
case withdraw_permission_object_type:{
457 accounts.insert( aobj->withdraw_from_account );
458 accounts.insert( aobj->authorized_account );
460 }
case vesting_balance_object_type:{
462 accounts.insert( aobj->owner );
464 }
case worker_object_type:{
466 accounts.insert( aobj->worker_account );
468 }
case balance_object_type:
471 case htlc_object_type:{
472 const auto* htlc_obj =
dynamic_cast<const htlc_object*
>(obj);
473 accounts.insert( htlc_obj->transfer.from );
474 accounts.insert( htlc_obj->transfer.to );
476 }
case custom_authority_object_type:{
478 accounts.insert( cust_auth_obj->account );
481 }
case ticket_object_type:{
482 const auto* aobj =
dynamic_cast<const ticket_object*
>( obj );
483 accounts.insert( aobj->account );
485 }
case liquidity_pool_object_type:
488 case samet_fund_object_type:{
490 accounts.insert( aobj->owner_account );
492 }
case credit_offer_object_type:{
494 accounts.insert( aobj->owner_account );
496 }
case credit_deal_object_type:{
498 accounts.insert( aobj->offer_owner );
499 accounts.insert( aobj->borrower );
507 switch( (impl_object_type)obj->
id.
type() )
509 case impl_global_property_object_type:
511 case impl_dynamic_global_property_object_type:
513 case impl_reserved0_object_type:
515 case impl_asset_dynamic_data_object_type:
517 case impl_asset_bitasset_data_object_type:
519 case impl_account_balance_object_type:{
521 accounts.insert( aobj->owner );
523 }
case impl_account_statistics_object_type:{
525 accounts.insert( aobj->owner );
527 }
case impl_transaction_history_object_type:{
530 ignore_custom_op_required_auths );
532 }
case impl_blinded_balance_object_type:{
534 for(
const auto& a : aobj->owner.account_auths )
535 accounts.insert( a.first );
537 }
case impl_block_summary_object_type:
539 case impl_account_history_object_type: {
541 accounts.insert( aobj->account );
543 }
case impl_chain_property_object_type:
545 case impl_witness_schedule_object_type:
547 case impl_budget_record_object_type:
549 case impl_special_authority_object_type:
551 case impl_buyback_object_type:
553 case impl_fba_accumulator_object_type:
555 case impl_collateral_bid_object_type:{
557 accounts.insert( aobj->bidder );
559 }
case impl_credit_deal_summary_object_type:{
561 accounts.insert( aobj->offer_owner );
562 accounts.insert( aobj->borrower );
580 void database::notify_changed_objects()
582 if( _undo_db.enabled() )
584 const auto& head_undo = _undo_db.head();
585 auto chain_time = head_block_time();
588 if( !new_objects.empty() )
590 vector<object_id_type> new_ids;
591 new_ids.reserve(head_undo.new_ids.size());
592 flat_set<account_id_type> new_accounts_impacted;
593 for(
const auto& item : head_undo.new_ids )
595 new_ids.push_back(item);
596 auto* obj = find_object(item);
598 get_relevant_accounts(obj, new_accounts_impacted,
599 MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
602 if( !new_ids.empty() )
607 if( !changed_objects.empty() )
609 vector<object_id_type> changed_ids;
610 changed_ids.reserve(head_undo.old_values.size());
611 flat_set<account_id_type> changed_accounts_impacted;
612 for(
const auto& item : head_undo.old_values )
614 changed_ids.push_back(item.first);
615 get_relevant_accounts(item.second.get(), changed_accounts_impacted,
616 MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
619 if( !changed_ids.empty() )
624 if( !removed_objects.empty() )
626 vector<object_id_type> removed_ids;
627 removed_ids.reserve( head_undo.removed.size() );
628 vector<const object*> removed;
629 removed.reserve( head_undo.removed.size() );
630 flat_set<account_id_type> removed_accounts_impacted;
631 for(
const auto& item : head_undo.removed )
633 removed_ids.emplace_back( item.first );
634 auto* obj = item.second.get();
635 removed.emplace_back( obj );
636 get_relevant_accounts(obj, removed_accounts_impacted,
637 MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
640 if( !removed_ids.empty() )
644 }
catch(
const graphene::chain::plugin_exception& e ) {
645 elog(
"Caught plugin exception: ${e}", (
"e", e.to_detail_string() ) );
void operator()(const asset_claim_pool_operation &op)
void operator()(const asset_update_bitasset_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
Tracks the balance of a single account/asset pairThis object is indexed on owner and asset_type so th...
account_id_type fee_payer() const
A credit offer is a fund that can be used by other accounts who provide certain collateral.
account_id_type fee_payer() const
Create a committee_member object, as a bid to hold a committee_member seat on the network...
account_id_type fee_payer() const
account_id_type fee_payer() const
get_impacted_account_visitor(flat_set< account_id_type > &impact, bool ignore_custom_op_required_auths)
account_id_type withdraw_from_account
Must match withdraw_permission->withdraw_from_account.
Update a committee_member object.Currently the only field which can be updated is the url field...
Update the set of feed-producing accounts for a BitAssetBitAssets have price feeds selected by taking...
void operator()(const asset_create_operation &op)
void operator()(const credit_offer_update_operation &op)
Manage an account's membership statusThis operation is used to upgrade an account to a member...
Create a new liquidity pool.
account_id_type from
Account to transfer asset from.
database object to store HTLCs
account_id_type new_issuer
account_id_type fee_payer() const
void operator()(const account_transfer_operation &op)
account_id_type fee_payer() const
account_id_type authorized_account
The account authorized to make withdrawals from withdraw_from_account.
account_id_type fee_payer() const
account_id_type borrower
The account who repays to the credit offer.
void operator()(const account_update_operation &op)
account_id_type fee_payer() const
flat_set< account_id_type > required_auths
vector< operation > operations
void add_authority_accounts(flat_set< account_id_type > &result, const authority &a)
void operator()(const htlc_extend_operation &op)
vector< blind_output > outputs
tracks the history of all logical operations on blockchain stateAll operations and virtual operations...
void operator()(const blind_transfer_operation &op)
A credit deal describes the details of a borrower's borrowing of funds from a credit offer...
void operator()(const withdraw_permission_delete_operation &op)
void operator()(const limit_order_create_operation &op)
Delete a custom authority.
tracks a blinded balance commitment
void operator()(const proposal_update_operation &op)
Delete an existing withdrawal permissionThis operation cancels a withdrawal permission, thus preventing any future withdrawals using that permission.
account_id_type fee_payer() const
void operator()(const account_whitelist_operation &op)
Create a witness object, as a bid to hold a witness position on the network.Accounts which wish to be...
used to transfer accumulated fees back to the issuer's balance.
account_id_type fee_payer() const
The proposal_delete_operation deletes an existing transaction proposalThis operation allows the early...
Update an existing account.
account_id_type fee_payer() const
void operator()(const asset_publish_feed_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const asset_reserve_operation &op)
void operator()(const balance_claim_operation &op)
tracks debt and call price information
void operator()(const proposal_create_operation &op)
void operator()(const samet_fund_borrow_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const fill_order_operation &op)
A credit deal summary describes the summary of a borrower's borrowing of funds from a credit offer...
optional< authority > active
New active authority. This can be updated by the current active authority.
Schedules a market-issued asset for automatic settlementHolders of market-issued assests may request ...
void operator()(const custom_authority_update_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
optional< authority > owner
New owner authority. If set, this operation requires owner authority to execute.
void operator()(const credit_deal_repay_operation &op)
account_id_type fee_payer() const
groups operations that should be applied atomically
void operator()(const vesting_balance_create_operation &op)
flat_set< account_id_type > & _impacted
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const liquidity_pool_delete_operation &op)
account_id_type fee_payer() const
account_id_type offer_owner
Owner of the credit offer.
visitor::result_type visit(visitor &v)
void transaction_get_impacted_accs(const transaction &tx, flat_set< account_id_type > &result, bool ignore_custom_op_required_auths)
Accept a creadit offer and create a credit deal.
Updates an existing ticket.
Withdraw from an account which has published a withdrawal permissionThis operation is used to withdra...
provides a generic way to add higher level protocols on top of witness consensusThere is no validatio...
Publish price feeds for market-issued assetsPrice feed providers use this operation to publish their ...
account_id_type fee_payer() const
account_id_type fee_payer() const
Create a new SameT Fund objectA SameT Fund is a fund which can be used by a borrower and have to be r...
void operator()(const committee_member_update_operation &op)
Update a SameT Fund object.
account_id_type fee_payer() const
void operator()(const witness_update_operation &op)
#define FC_CAPTURE_AND_LOG(...)
Update a custom authority.
Allows the issuer of an asset to transfer an asset from any account to any account if they have overr...
account_id_type fee_payer() const
void operator()(const ticket_update_operation &op)
void operator()(const asset_issue_operation &op)
Tracks account custom authorities.
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenariosCreates a...
account_id_type fee_payer() const
void operator()(const committee_member_update_global_parameters_operation &op)
void operator()(const liquidity_pool_deposit_operation &op)
account_id_type fee_payer() const
void operator()(const account_upgrade_operation &op)
void operator()(const samet_fund_create_operation &op)
account_id_type authorized_account
The account authorized to make withdrawals. Must match permission_to_update->authorized_account.
void operator()(const htlc_redeem_operation &op)
account_id_type fee_payer() const
Delete a SameT Fund object.
void operator()(const asset_update_operation &op)
Grants another account authority to withdraw a limited amount of funds per interval.
used to take an asset out of circulation, returning to the issuer
Claim a balance in a graphene::chain::balance_object.
void operator()(const liquidity_pool_exchange_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
Transfers an amount of one asset from one account to another.
account_id_type fee_payer() const
assert that some conditions are true.This operation performs no changes to the database state...
vector< blind_input > inputs
void operator()(const credit_offer_create_operation &op)
Converts blinded/stealth balance to a public account balance.
void operator()(const worker_create_operation &op)
account_id_type referrer
This account receives a portion of the fee split between registrar and referrer. Must be a member...
void operator()(const asset_settle_cancel_operation &op)
account_id_type fee_payer() const
void operator()(const assert_operation &op)
account_id_type fee_payer() const
void operator()(const asset_global_settle_operation &op)
a node in a linked list of operation_history_objectsAccount history is important for users and wallet...
account_id_type fee_payer() const
who will pay the fee
account_id_type fee_payer() const
bool _ignore_custom_op_reqd_auths
Update a witness object's URL and block signing key.
Withdraw from a liquidity pool.
Create a vesting balance.The chain allows a user to create a vesting balance. Normally, vesting balances are created automatically as part of cashback and worker operations. This operation allows vesting balances to be created manually as well.
tracks bitassets scheduled for force settlement at some point in the future.
void operator()(const custom_operation &op)
account_id_type fee_payer() const
instructs the blockchain to attempt to sell one asset for anotherThe blockchain will atempt to sell a...
Update options specific to BitAssetsBitAssets have some options which are not relevant to other asset...
account_id_type fee_payer() const
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
optional< authority > new_auth
Change to the authentication for the custom authority.
Exchange with a liquidity pool.
account_id_type fee_payer() const
adds a signature to a transaction
A credit deal expired without being fully repaid.
account_id_type fee_payer() const
Who is to pay the fee.
account_id_type fee_payer() const
vector< op_wrapper > proposed_ops
vector< blind_input > inputs
account_id_type fee_payer() const
void operator()(const samet_fund_update_operation &op)
void operator()(const ticket_create_operation &op)
Update options common to all assetsThere are a number of options which all assets in the network use...
void operator()(const vesting_balance_withdraw_operation &op)
void operator()(const credit_deal_expired_operation &op)
account_id_type fee_payer() const
bids of collateral for debt after a black swan
account_id_type fee_payer() const
void operator()(const asset_update_feed_producers_operation &op)
void operator()(const account_create_operation &op)
account_id_type owner
Who is able to withdraw the balance.
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
This operation is used to whitelist and blacklist accounts, primarily for transacting in whitelisted ...
void operator()(const htlc_create_operation &op)
void operator()(const liquidity_pool_create_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
Withdraw from a vesting balance.Withdrawal from a not-completely-mature vesting balance will result i...
void operator()(const transfer_to_blind_operation &op)
account_id_type fee_payer() const
void operator()(const custom_authority_create_operation &op)
void operator()(const credit_offer_accept_operation &op)
void operator()(const custom_authority_delete_operation &op)
void operator()(const committee_member_create_operation &op)
Update an existing withdraw permissionThis oeration is used to update the settings for an existing wi...
account_id_type fee_payer() const
void operator()(const transfer_from_blind_operation &op)
void operator()(const withdraw_permission_create_operation &op)
void operator()(const bid_collateral_operation &op)
tracks the parameters of an assetAll assets have a globally unique symbol name that controls how they...
account_id_type fee_payer() const
account_id_type to
Account to transfer asset to.
account_id_type fee_payer() const
account_id_type fee_payer() const
#define GRAPHENE_TRY_NOTIFY(signal,...)
account_id_type fee_payer() const
account_id_type fee_payer() const
Who is to pay the fee.
account_id_type fee_payer() const
The proposal_update_operation updates an existing transaction proposalThis operation allows accounts ...
void operator()(const override_transfer_operation &op)
account_id_type fee_payer() const
Worker object contains the details of a blockchain worker. See The Blockchain Worker System for detai...
account_id_type fee_payer() const
vector< blind_output > outputs
void operator()(const liquidity_pool_withdraw_operation &op)
account_id_type fee_payer() const
void operator()(const transfer_operation &op)
void operator()(const withdraw_permission_update_operation &op)
authority auth
Authentication requirements for the custom authority.
A SameT Fund is a fund which can be used by a borrower and have to be repaid in the same transaction...
void operator()(const limit_order_cancel_operation &op)
account_id_type authorized_account
The account previously authorized to make withdrawals. Must match withdrawal_permission->authorized_a...
account_id_type fee_payer() const
void operator()(const asset_settle_operation &op)
void operator()(const call_order_update_operation &op)
void operator()(const witness_create_operation &op)
account_id_type fee_payer() const
void operator()(const samet_fund_delete_operation &op)
Update issuer of an assetAn issuer has general administrative power of an asset and in some cases als...
Used by committee_members to update the global parameters of the blockchain.This operation allows the...
void operator()(const samet_fund_repay_operation &op)
account_id_type fee_payer() const
void operator()(const asset_fund_fee_pool_operation &op)
void operator()(const fba_distribute_operation &op)
void operator()(const withdraw_permission_claim_operation &op)
account_id_type fee_payer() const
void operator()(const execute_bid_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
Borrow from a SameT Fund.
account_id_type fee_payer() const
transfers the account to another account while clearing the white listIn theory an account can be tra...
tracks information about a committee_member account.A committee_member is responsible for setting blo...
Transfers from blind to blind.
a ticket for governance voting
void operator()(const credit_offer_delete_operation &op)
void operation_get_required_authorities(const operation &op, flat_set< account_id_type > &active, flat_set< account_id_type > &owner, vector< authority > &other, bool ignore_custom_operation_required_auths)
void operation_get_impacted_accounts(const operation &op, flat_set< account_id_type > &result, bool ignore_custom_op_required_auths)
void operator()(const asset_update_issuer_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type to
Account to transfer asset to.
Deposit to a liquidity pool.
Create a new worker object.
void operator()(const proposal_delete_operation &op)
void operator()(const htlc_redeemed_operation &op)
Create a new withdrawal permissionThis operation creates a withdrawal permission, which allows some a...
account_id_type fee_payer() const
Create a new custom authority.
account_id_type fee_payer() const
account_id_type account_to_list
The account being opined about.
Converts public account balance to a blinded or stealth balance.
account_id_type fee_payer() const
account_id_type issue_to_account
void operator()(const htlc_refund_operation &op)
account_id_type fee_payer() const
allows global settling of bitassets (black swan or prediction markets)
an offer to sell an amount of an asset at a specified exchange rate by a certain timeThe objects are ...
optional< account_id_type > new_issuer
If the asset is to be given a new issuer, specify his ID here.
Create a new credit offerA credit offer is a fund that can be used by other accounts who provide cert...
tracks the approval of a partially approved transaction
void operator()(const asset_claim_fees_operation &op)
account_id_type fee_payer() const