Adding extension points #141

This commit is contained in:
Daniel Larimer 2015-07-09 17:29:30 -04:00
parent 04b8820b3b
commit a799f064d4
13 changed files with 80 additions and 30 deletions

View file

@ -26,6 +26,7 @@ namespace graphene { namespace chain {
/// This is the list of vote IDs this account votes for. The weight of these votes is determined by this /// This is the list of vote IDs this account votes for. The weight of these votes is determined by this
/// account's balance of core asset. /// account's balance of core asset.
flat_set<vote_id_type> votes; flat_set<vote_id_type> votes;
extensions_type extensions;
void validate()const; void validate()const;
}; };
@ -56,6 +57,7 @@ namespace graphene { namespace chain {
authority active; authority active;
account_options options; account_options options;
extensions_type extensions;
account_id_type fee_payer()const { return registrar; } account_id_type fee_payer()const { return registrar; }
void validate()const; void validate()const;
@ -95,6 +97,7 @@ namespace graphene { namespace chain {
/// New account options /// New account options
optional<account_options> new_options; optional<account_options> new_options;
extensions_type extensions;
account_id_type fee_payer()const { return account; } account_id_type fee_payer()const { return account; }
void validate()const; void validate()const;
@ -150,6 +153,7 @@ namespace graphene { namespace chain {
/// The new white and blacklist status of account_to_list, as determined by authorizing_account /// The new white and blacklist status of account_to_list, as determined by authorizing_account
/// This is a bitfield using values defined in the account_listing enum /// This is a bitfield using values defined in the account_listing enum
uint8_t new_listing; uint8_t new_listing;
extensions_type extensions;
account_id_type fee_payer()const { return authorizing_account; } account_id_type fee_payer()const { return authorizing_account; }
void validate()const { FC_ASSERT( fee.amount >= 0 ); FC_ASSERT(new_listing < 0x4); } void validate()const { FC_ASSERT( fee.amount >= 0 ); FC_ASSERT(new_listing < 0x4); }
@ -185,6 +189,7 @@ namespace graphene { namespace chain {
account_id_type account_to_upgrade; account_id_type account_to_upgrade;
/// If true, the account will be upgraded to a lifetime member; otherwise, it will add a year to the subscription /// If true, the account will be upgraded to a lifetime member; otherwise, it will add a year to the subscription
bool upgrade_to_lifetime_member = false; bool upgrade_to_lifetime_member = false;
extensions_type extensions;
account_id_type fee_payer()const { return account_to_upgrade; } account_id_type fee_payer()const { return account_to_upgrade; }
void validate()const; void validate()const;
@ -211,6 +216,7 @@ namespace graphene { namespace chain {
asset fee; asset fee;
account_id_type account_id; account_id_type account_id;
account_id_type new_owner; account_id_type new_owner;
extensions_type extensions;
account_id_type fee_payer()const { return account_id; } account_id_type fee_payer()const { return account_id; }
void validate()const; void validate()const;
@ -223,7 +229,7 @@ namespace graphene { namespace chain {
}; };
} } } }
FC_REFLECT(graphene::chain::account_options, (memo_key)(voting_account)(num_witness)(num_committee)(votes)) FC_REFLECT(graphene::chain::account_options, (memo_key)(voting_account)(num_witness)(num_committee)(votes)(extensions))
FC_REFLECT_TYPENAME( graphene::chain::account_whitelist_operation::account_listing) FC_REFLECT_TYPENAME( graphene::chain::account_whitelist_operation::account_listing)
FC_REFLECT_ENUM( graphene::chain::account_whitelist_operation::account_listing, FC_REFLECT_ENUM( graphene::chain::account_whitelist_operation::account_listing,
(no_listing)(white_listed)(black_listed)(white_and_black_listed)) (no_listing)(white_listed)(black_listed)(white_and_black_listed))
@ -231,16 +237,16 @@ FC_REFLECT_ENUM( graphene::chain::account_whitelist_operation::account_listing,
FC_REFLECT( graphene::chain::account_create_operation, FC_REFLECT( graphene::chain::account_create_operation,
(fee)(registrar) (fee)(registrar)
(referrer)(referrer_percent) (referrer)(referrer_percent)
(name)(owner)(active)(options) (name)(owner)(active)(options)(extensions)
) )
FC_REFLECT( graphene::chain::account_update_operation, FC_REFLECT( graphene::chain::account_update_operation,
(fee)(account)(owner)(active)(new_options) (fee)(account)(owner)(active)(new_options)(extensions)
) )
FC_REFLECT( graphene::chain::account_upgrade_operation, FC_REFLECT( graphene::chain::account_upgrade_operation,
(fee)(account_to_upgrade)(upgrade_to_lifetime_member) ) (fee)(account_to_upgrade)(upgrade_to_lifetime_member)(extensions) )
FC_REFLECT( graphene::chain::account_whitelist_operation, (fee)(authorizing_account)(account_to_list)(new_listing)) FC_REFLECT( graphene::chain::account_whitelist_operation, (fee)(authorizing_account)(account_to_list)(new_listing)(extensions))
FC_REFLECT( graphene::chain::account_create_operation::fee_parameters_type, (basic_fee)(premium_fee)(price_per_kbyte) ) FC_REFLECT( graphene::chain::account_create_operation::fee_parameters_type, (basic_fee)(premium_fee)(price_per_kbyte) )
FC_REFLECT( graphene::chain::account_whitelist_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::account_whitelist_operation::fee_parameters_type, (fee) )
@ -248,4 +254,4 @@ FC_REFLECT( graphene::chain::account_update_operation::fee_parameters_type, (fee
FC_REFLECT( graphene::chain::account_upgrade_operation::fee_parameters_type, (membership_annual_fee)(membership_lifetime_fee) ) FC_REFLECT( graphene::chain::account_upgrade_operation::fee_parameters_type, (membership_annual_fee)(membership_lifetime_fee) )
FC_REFLECT( graphene::chain::account_transfer_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::account_transfer_operation::fee_parameters_type, (fee) )
FC_REFLECT( graphene::chain::account_transfer_operation, (fee)(account_id)(new_owner) ) FC_REFLECT( graphene::chain::account_transfer_operation, (fee)(account_id)(new_owner)(extensions) )

View file

@ -59,6 +59,7 @@ namespace graphene { namespace chain {
account_id_type fee_paying_account; account_id_type fee_paying_account;
vector<predicate> predicates; vector<predicate> predicates;
flat_set<account_id_type> required_auths; flat_set<account_id_type> required_auths;
extensions_type extensions;
account_id_type fee_payer()const { return fee_paying_account; } account_id_type fee_payer()const { return fee_paying_account; }
void validate()const; void validate()const;
@ -71,4 +72,4 @@ FC_REFLECT( graphene::chain::assert_operation::fee_parameters_type, (fee) )
FC_REFLECT( graphene::chain::account_name_eq_lit_predicate, (account_id)(name) ) FC_REFLECT( graphene::chain::account_name_eq_lit_predicate, (account_id)(name) )
FC_REFLECT( graphene::chain::asset_symbol_eq_lit_predicate, (asset_id)(symbol) ) FC_REFLECT( graphene::chain::asset_symbol_eq_lit_predicate, (asset_id)(symbol) )
FC_REFLECT_TYPENAME( graphene::chain::predicate ) FC_REFLECT_TYPENAME( graphene::chain::predicate )
FC_REFLECT( graphene::chain::assert_operation, (fee)(fee_paying_account)(predicates)(required_auths) ) FC_REFLECT( graphene::chain::assert_operation, (fee)(fee_paying_account)(predicates)(required_auths)(extensions) )

View file

@ -53,6 +53,7 @@ namespace graphene { namespace chain {
* size of description. * size of description.
*/ */
string description; string description;
extensions_type extensions;
/// Perform internal consistency checks. /// Perform internal consistency checks.
/// @throws fc::exception if any check fails /// @throws fc::exception if any check fails
@ -82,6 +83,7 @@ namespace graphene { namespace chain {
/// This speicifies which asset type is used to collateralize short sales /// This speicifies which asset type is used to collateralize short sales
/// This field may only be updated if the current supply of the asset is zero. /// This field may only be updated if the current supply of the asset is zero.
asset_id_type short_backing_asset; asset_id_type short_backing_asset;
extensions_type extensions;
/// Perform internal consistency checks. /// Perform internal consistency checks.
/// @throws fc::exception if any check fails /// @throws fc::exception if any check fails
@ -120,6 +122,7 @@ namespace graphene { namespace chain {
optional<bitasset_options> bitasset_opts; optional<bitasset_options> bitasset_opts;
/// For BitAssets, set this to true if the asset implements a @ref prediction_market; false otherwise /// For BitAssets, set this to true if the asset implements a @ref prediction_market; false otherwise
bool is_prediction_market = false; bool is_prediction_market = false;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -144,6 +147,7 @@ namespace graphene { namespace chain {
account_id_type issuer; ///< must equal @ref asset_to_settle->issuer account_id_type issuer; ///< must equal @ref asset_to_settle->issuer
asset_id_type asset_to_settle; asset_id_type asset_to_settle;
price settle_price; price settle_price;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -179,6 +183,7 @@ namespace graphene { namespace chain {
account_id_type account; account_id_type account;
/// Amount of asset to force settle. This must be a market-issued asset /// Amount of asset to force settle. This must be a market-issued asset
asset amount; asset amount;
extensions_type extensions;
account_id_type fee_payer()const { return account; } account_id_type fee_payer()const { return account; }
void validate()const; void validate()const;
@ -195,6 +200,7 @@ namespace graphene { namespace chain {
account_id_type from_account; account_id_type from_account;
asset_id_type asset_id; asset_id_type asset_id;
share_type amount; ///< core asset share_type amount; ///< core asset
extensions_type extensions;
account_id_type fee_payer()const { return from_account; } account_id_type fee_payer()const { return from_account; }
void validate()const; void validate()const;
@ -231,6 +237,7 @@ namespace graphene { namespace chain {
/// If the asset is to be given a new issuer, specify his ID here. /// If the asset is to be given a new issuer, specify his ID here.
optional<account_id_type> new_issuer; optional<account_id_type> new_issuer;
asset_options new_options; asset_options new_options;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -261,6 +268,7 @@ namespace graphene { namespace chain {
asset_id_type asset_to_update; asset_id_type asset_to_update;
bitasset_options new_options; bitasset_options new_options;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -291,6 +299,7 @@ namespace graphene { namespace chain {
asset_id_type asset_to_update; asset_id_type asset_to_update;
flat_set<account_id_type> new_feed_producers; flat_set<account_id_type> new_feed_producers;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -320,6 +329,7 @@ namespace graphene { namespace chain {
account_id_type publisher; account_id_type publisher;
asset_id_type asset_id; ///< asset for which the feed is published asset_id_type asset_id; ///< asset for which the feed is published
price_feed feed; price_feed feed;
extensions_type extensions;
account_id_type fee_payer()const { return publisher; } account_id_type fee_payer()const { return publisher; }
void validate()const; void validate()const;
@ -343,6 +353,7 @@ namespace graphene { namespace chain {
/** user provided data encrypted to the memo key of the "to" account */ /** user provided data encrypted to the memo key of the "to" account */
optional<memo_data> memo; optional<memo_data> memo;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -364,6 +375,7 @@ namespace graphene { namespace chain {
asset fee; asset fee;
account_id_type payer; account_id_type payer;
asset amount_to_reserve; asset amount_to_reserve;
extensions_type extensions;
account_id_type fee_payer()const { return payer; } account_id_type fee_payer()const { return payer; }
void validate()const; void validate()const;
@ -383,6 +395,7 @@ FC_REFLECT( graphene::chain::asset_options,
(whitelist_markets) (whitelist_markets)
(blacklist_markets) (blacklist_markets)
(description) (description)
(extensions)
) )
FC_REFLECT( graphene::chain::bitasset_options, FC_REFLECT( graphene::chain::bitasset_options,
(feed_lifetime_sec) (feed_lifetime_sec)
@ -391,6 +404,7 @@ FC_REFLECT( graphene::chain::bitasset_options,
(force_settlement_offset_percent) (force_settlement_offset_percent)
(maximum_force_settlement_volume) (maximum_force_settlement_volume)
(short_backing_asset) (short_backing_asset)
(extensions)
) )
@ -414,6 +428,7 @@ FC_REFLECT( graphene::chain::asset_create_operation,
(common_options) (common_options)
(bitasset_opts) (bitasset_opts)
(is_prediction_market) (is_prediction_market)
(extensions)
) )
FC_REFLECT( graphene::chain::asset_update_operation, FC_REFLECT( graphene::chain::asset_update_operation,
(fee) (fee)
@ -421,24 +436,26 @@ FC_REFLECT( graphene::chain::asset_update_operation,
(asset_to_update) (asset_to_update)
(new_issuer) (new_issuer)
(new_options) (new_options)
(extensions)
) )
FC_REFLECT( graphene::chain::asset_update_bitasset_operation, FC_REFLECT( graphene::chain::asset_update_bitasset_operation,
(fee) (fee)
(issuer) (issuer)
(asset_to_update) (asset_to_update)
(new_options) (new_options)
(extensions)
) )
FC_REFLECT( graphene::chain::asset_update_feed_producers_operation, FC_REFLECT( graphene::chain::asset_update_feed_producers_operation,
(fee)(issuer)(asset_to_update)(new_feed_producers) (fee)(issuer)(asset_to_update)(new_feed_producers)(extensions)
) )
FC_REFLECT( graphene::chain::asset_publish_feed_operation, FC_REFLECT( graphene::chain::asset_publish_feed_operation,
(fee)(publisher)(asset_id)(feed) ) (fee)(publisher)(asset_id)(feed)(extensions) )
FC_REFLECT( graphene::chain::asset_settle_operation, (fee)(account)(amount) ) FC_REFLECT( graphene::chain::asset_settle_operation, (fee)(account)(amount)(extensions) )
FC_REFLECT( graphene::chain::asset_global_settle_operation, (fee)(issuer)(asset_to_settle)(settle_price) ) FC_REFLECT( graphene::chain::asset_global_settle_operation, (fee)(issuer)(asset_to_settle)(settle_price)(extensions) )
FC_REFLECT( graphene::chain::asset_issue_operation, FC_REFLECT( graphene::chain::asset_issue_operation,
(fee)(issuer)(asset_to_issue)(issue_to_account)(memo) ) (fee)(issuer)(asset_to_issue)(issue_to_account)(memo)(extensions) )
FC_REFLECT( graphene::chain::asset_reserve_operation, FC_REFLECT( graphene::chain::asset_reserve_operation,
(fee)(payer)(amount_to_reserve) ) (fee)(payer)(amount_to_reserve)(extensions) )
FC_REFLECT( graphene::chain::asset_fund_fee_pool_operation, (fee)(from_account)(asset_id)(amount) ); FC_REFLECT( graphene::chain::asset_fund_fee_pool_operation, (fee)(from_account)(asset_id)(amount)(extensions) );

View file

@ -81,6 +81,23 @@ namespace graphene { namespace chain {
} }
}; };
/**
* For future expansion many structus include a single member of type
* extensions_type that can be changed when updating a protocol. You can
* always add new types to a static_variant without breaking backward
* compatibility.
*/
typedef static_variant<void_t> future_extensions;
/**
* A flat_set is used to make sure that only one extension of
* each type is added and that they are added in order.
*
* @note static_variant compares only the type tag and not the
* content.
*/
typedef flat_set<future_extensions> extensions_type;
///@} ///@}
} } } }

View file

@ -20,9 +20,6 @@
namespace graphene { namespace chain { namespace graphene { namespace chain {
struct void_header{};
typedef fc::static_variant<void_header> header_extension;
struct block_header struct block_header
{ {
digest_type digest()const; digest_type digest()const;
@ -33,7 +30,7 @@ namespace graphene { namespace chain {
secret_hash_type next_secret_hash; secret_hash_type next_secret_hash;
secret_hash_type previous_secret; secret_hash_type previous_secret;
checksum_type transaction_merkle_root; checksum_type transaction_merkle_root;
flat_set<header_extension> extensions; extensions_type extensions;
static uint32_t num_from_id(const block_id_type& id); static uint32_t num_from_id(const block_id_type& id);
}; };
@ -56,7 +53,6 @@ namespace graphene { namespace chain {
} } // graphene::chain } } // graphene::chain
FC_REFLECT( graphene::chain::void_header, )
FC_REFLECT( graphene::chain::block_header, (previous)(timestamp)(witness) FC_REFLECT( graphene::chain::block_header, (previous)(timestamp)(witness)
(next_secret_hash)(previous_secret)(transaction_merkle_root)(extensions) ) (next_secret_hash)(previous_secret)(transaction_merkle_root)(extensions) )
FC_REFLECT_DERIVED( graphene::chain::signed_block_header, (graphene::chain::block_header), (delegate_signature) ) FC_REFLECT_DERIVED( graphene::chain::signed_block_header, (graphene::chain::block_header), (delegate_signature) )

View file

@ -63,7 +63,7 @@ namespace graphene { namespace chain {
share_type fee_liquidation_threshold = GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD; ///< value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated share_type fee_liquidation_threshold = GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD; ///< value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated
uint16_t accounts_per_fee_scale = GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE; ///< number of accounts between fee scalings uint16_t accounts_per_fee_scale = GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE; ///< number of accounts between fee scalings
uint8_t account_fee_scale_bitshifts = GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS; ///< number of times to left bitshift account registration fee at each scaling uint8_t account_fee_scale_bitshifts = GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS; ///< number of times to left bitshift account registration fee at each scaling
flat_set<parameter_extension> extensions; extensions_type extensions;
void validate()const void validate()const
{ {

View file

@ -36,6 +36,7 @@ namespace graphene { namespace chain {
/// If this flag is set the entire order must be filled or the operation is rejected /// If this flag is set the entire order must be filled or the operation is rejected
bool fill_or_kill = false; bool fill_or_kill = false;
extensions_type extensions;
pair<asset_id_type,asset_id_type> get_market()const pair<asset_id_type,asset_id_type> get_market()const
{ {
@ -64,6 +65,7 @@ namespace graphene { namespace chain {
limit_order_id_type order; limit_order_id_type order;
/** must be order->seller */ /** must be order->seller */
account_id_type fee_paying_account; account_id_type fee_paying_account;
extensions_type extensions;
account_id_type fee_payer()const { return fee_paying_account; } account_id_type fee_payer()const { return fee_paying_account; }
void validate()const; void validate()const;
@ -92,6 +94,7 @@ namespace graphene { namespace chain {
account_id_type funding_account; ///< pays fee, collateral, and cover account_id_type funding_account; ///< pays fee, collateral, and cover
asset delta_collateral; ///< the amount of collateral to add to the margin position asset delta_collateral; ///< the amount of collateral to add to the margin position
asset delta_debt; ///< the amount of the debt to be paid off, may be negative to issue new debt asset delta_debt; ///< the amount of the debt to be paid off, may be negative to issue new debt
extensions_type extensions;
account_id_type fee_payer()const { return funding_account; } account_id_type fee_payer()const { return funding_account; }
void validate()const; void validate()const;
@ -143,7 +146,7 @@ FC_REFLECT( graphene::chain::call_order_update_operation::fee_parameters_type, (
FC_REFLECT( graphene::chain::fill_order_operation::fee_parameters_type, ) FC_REFLECT( graphene::chain::fill_order_operation::fee_parameters_type, )
FC_REFLECT( graphene::chain::limit_order_create_operation,(fee)(seller)(amount_to_sell)(min_to_receive)(expiration)(fill_or_kill)) FC_REFLECT( graphene::chain::limit_order_create_operation,(fee)(seller)(amount_to_sell)(min_to_receive)(expiration)(fill_or_kill)(extensions))
FC_REFLECT( graphene::chain::limit_order_cancel_operation,(fee)(fee_paying_account)(order) ) FC_REFLECT( graphene::chain::limit_order_cancel_operation,(fee)(fee_paying_account)(order)(extensions) )
FC_REFLECT( graphene::chain::call_order_update_operation, (fee)(funding_account)(delta_collateral)(delta_debt) ) FC_REFLECT( graphene::chain::call_order_update_operation, (fee)(funding_account)(delta_collateral)(delta_debt)(extensions) )
FC_REFLECT( graphene::chain::fill_order_operation, (fee)(order_id)(account_id)(pays)(receives) ) FC_REFLECT( graphene::chain::fill_order_operation, (fee)(order_id)(account_id)(pays)(receives) )

View file

@ -55,6 +55,7 @@ namespace graphene { namespace chain {
vector<op_wrapper> proposed_ops; vector<op_wrapper> proposed_ops;
time_point_sec expiration_time; time_point_sec expiration_time;
optional<uint32_t> review_period_seconds; optional<uint32_t> review_period_seconds;
extensions_type extensions;
/// Constructs a proposal_create_operation suitable for genesis proposals, with fee, expiration time and review /// Constructs a proposal_create_operation suitable for genesis proposals, with fee, expiration time and review
/// period set appropriately. /// period set appropriately.
@ -101,6 +102,7 @@ namespace graphene { namespace chain {
flat_set<account_id_type> owner_approvals_to_remove; flat_set<account_id_type> owner_approvals_to_remove;
flat_set<public_key_type> key_approvals_to_add; flat_set<public_key_type> key_approvals_to_add;
flat_set<public_key_type> key_approvals_to_remove; flat_set<public_key_type> key_approvals_to_remove;
extensions_type extensions;
account_id_type fee_payer()const { return fee_paying_account; } account_id_type fee_payer()const { return fee_paying_account; }
void validate()const; void validate()const;
@ -129,6 +131,7 @@ namespace graphene { namespace chain {
bool using_owner_authority = false; bool using_owner_authority = false;
asset fee; asset fee;
proposal_id_type proposal; proposal_id_type proposal;
extensions_type extensions;
account_id_type fee_payer()const { return fee_paying_account; } account_id_type fee_payer()const { return fee_paying_account; }
void validate()const; void validate()const;
@ -142,9 +145,9 @@ FC_REFLECT( graphene::chain::proposal_update_operation::fee_parameters_type, (fe
FC_REFLECT( graphene::chain::proposal_delete_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::proposal_delete_operation::fee_parameters_type, (fee) )
FC_REFLECT( graphene::chain::proposal_create_operation, (fee)(fee_paying_account)(expiration_time) FC_REFLECT( graphene::chain::proposal_create_operation, (fee)(fee_paying_account)(expiration_time)
(proposed_ops)(review_period_seconds) ) (proposed_ops)(review_period_seconds)(extensions) )
FC_REFLECT( graphene::chain::proposal_update_operation, (fee)(fee_paying_account)(proposal) FC_REFLECT( graphene::chain::proposal_update_operation, (fee)(fee_paying_account)(proposal)
(active_approvals_to_add)(active_approvals_to_remove)(owner_approvals_to_add)(owner_approvals_to_remove) (active_approvals_to_add)(active_approvals_to_remove)(owner_approvals_to_add)(owner_approvals_to_remove)
(key_approvals_to_add)(key_approvals_to_remove) ) (key_approvals_to_add)(key_approvals_to_remove)(extensions) )
FC_REFLECT( graphene::chain::proposal_delete_operation, (fee)(fee_paying_account)(using_owner_authority)(proposal) ) FC_REFLECT( graphene::chain::proposal_delete_operation, (fee)(fee_paying_account)(using_owner_authority)(proposal)(extensions) )

View file

@ -87,6 +87,7 @@ namespace graphene { namespace chain {
*/ */
uint16_t relative_expiration = 1; uint16_t relative_expiration = 1;
vector<operation> operations; vector<operation> operations;
extensions_type extensions;
/// Calculate the digest for a transaction with a reference block /// Calculate the digest for a transaction with a reference block
/// @param ref_block_id Full block ID of the reference block /// @param ref_block_id Full block ID of the reference block
@ -164,6 +165,6 @@ namespace graphene { namespace chain {
} } } }
FC_REFLECT( graphene::chain::transaction, (ref_block_num)(ref_block_prefix)(relative_expiration)(operations) ) FC_REFLECT( graphene::chain::transaction, (ref_block_num)(ref_block_prefix)(relative_expiration)(operations)(extensions) )
FC_REFLECT_DERIVED( graphene::chain::signed_transaction, (graphene::chain::transaction), (signatures) ) FC_REFLECT_DERIVED( graphene::chain::signed_transaction, (graphene::chain::transaction), (signatures) )
FC_REFLECT_DERIVED( graphene::chain::processed_transaction, (graphene::chain::signed_transaction), (operation_results) ) FC_REFLECT_DERIVED( graphene::chain::processed_transaction, (graphene::chain::signed_transaction), (operation_results) )

View file

@ -35,6 +35,7 @@ namespace graphene { namespace chain {
/// User provided data encrypted to the memo key of the "to" account /// User provided data encrypted to the memo key of the "to" account
optional<memo_data> memo; optional<memo_data> memo;
extensions_type extensions;
account_id_type fee_payer()const { return from; } account_id_type fee_payer()const { return from; }
void validate()const; void validate()const;
@ -69,6 +70,7 @@ namespace graphene { namespace chain {
/// User provided data encrypted to the memo key of the "to" account /// User provided data encrypted to the memo key of the "to" account
optional<memo_data> memo; optional<memo_data> memo;
extensions_type extensions;
account_id_type fee_payer()const { return issuer; } account_id_type fee_payer()const { return issuer; }
void validate()const; void validate()const;
@ -86,6 +88,6 @@ namespace graphene { namespace chain {
FC_REFLECT( graphene::chain::transfer_operation::fee_parameters_type, (fee)(price_per_kbyte) ) FC_REFLECT( graphene::chain::transfer_operation::fee_parameters_type, (fee)(price_per_kbyte) )
FC_REFLECT( graphene::chain::override_transfer_operation::fee_parameters_type, (fee)(price_per_kbyte) ) FC_REFLECT( graphene::chain::override_transfer_operation::fee_parameters_type, (fee)(price_per_kbyte) )
FC_REFLECT( graphene::chain::override_transfer_operation, (fee)(issuer)(from)(to)(amount)(memo) ) FC_REFLECT( graphene::chain::override_transfer_operation, (fee)(issuer)(from)(to)(amount)(memo)(extensions) )
FC_REFLECT( graphene::chain::transfer_operation, (fee)(from)(to)(amount)(memo) ) FC_REFLECT( graphene::chain::transfer_operation, (fee)(from)(to)(amount)(memo)(extensions) )

View file

@ -73,6 +73,7 @@ namespace graphene { namespace chain {
using fc::ecc::range_proof_type; using fc::ecc::range_proof_type;
using fc::ecc::range_proof_info; using fc::ecc::range_proof_info;
using fc::ecc::commitment_type; using fc::ecc::commitment_type;
struct void_t{};
typedef fc::ecc::private_key private_key_type; typedef fc::ecc::private_key private_key_type;
@ -423,5 +424,6 @@ FC_REFLECT_TYPENAME( graphene::chain::transaction_obj_id_type )
FC_REFLECT_TYPENAME( graphene::chain::block_summary_id_type ) FC_REFLECT_TYPENAME( graphene::chain::block_summary_id_type )
FC_REFLECT_TYPENAME( graphene::chain::account_transaction_history_id_type ) FC_REFLECT_TYPENAME( graphene::chain::account_transaction_history_id_type )
FC_REFLECT_TYPENAME( graphene::chain::witness_schedule_id_type ) FC_REFLECT_TYPENAME( graphene::chain::witness_schedule_id_type )
FC_REFLECT( graphene::chain::void_t, )
FC_REFLECT_ENUM( graphene::chain::asset_issuer_permission_flags, (charge_market_fee)(white_list)(transfer_restricted)(override_authority)(disable_force_settle)(global_settle) ) FC_REFLECT_ENUM( graphene::chain::asset_issuer_permission_flags, (charge_market_fee)(white_list)(transfer_restricted)(override_authority)(disable_force_settle)(global_settle) )

View file

@ -375,7 +375,7 @@ int main( int argc, char** argv )
detail_ns::js_name<fee_parameters>::name("fee_parameters"); detail_ns::js_name<fee_parameters>::name("fee_parameters");
detail_ns::js_name<operation>::name("operation"); detail_ns::js_name<operation>::name("operation");
detail_ns::js_name<operation_result>::name("operation_result"); detail_ns::js_name<operation_result>::name("operation_result");
detail_ns::js_name<header_extension>::name("header_extension"); detail_ns::js_name<operation_extensions>::name("future_extensions");
detail_ns::js_name<worker_initializer>::name("worker_initializer"); detail_ns::js_name<worker_initializer>::name("worker_initializer");
detail_ns::js_name<predicate>::name("predicate"); detail_ns::js_name<predicate>::name("predicate");
detail_ns::js_name<vesting_policy_initializer>::name("vesting_policy_initializer"); detail_ns::js_name<vesting_policy_initializer>::name("vesting_policy_initializer");

View file

@ -86,5 +86,7 @@ int main( int argc, char** argv )
std::cout << "]\n"; std::cout << "]\n";
} }
catch ( const fc::exception& e ){ edump((e.to_detail_string())); } catch ( const fc::exception& e ){ edump((e.to_detail_string())); }
idump((sizeof(signed_block)));
idump((fc::raw::pack_size(signed_block())));
return 0; return 0;
} }