Skip to content

Commit

Permalink
Fix some Doxygen warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Oct 18, 2022
1 parent 3b97053 commit e882a8b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 43 deletions.
21 changes: 9 additions & 12 deletions libraries/chain/include/graphene/chain/database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,8 @@ namespace graphene { namespace chain {
bool mute_exceptions = false,
bool skip_matching_settle_orders = false );

/**
* Matches the two orders, the first parameter is taker, the second is maker.
*
* @return a bit field indicating which orders were filled (and thus removed)
*
* 0 - no orders were matched
* 1 - only taker was filled
* 2 - only maker was filled
* 3 - both were filled
*/
///@{
// Note: Ideally this should be private.
// Now it is public because we use it in a non-member function in db_market.cpp .
enum class match_result_type
{
none_filled = 0,
Expand All @@ -412,6 +403,12 @@ namespace graphene { namespace chain {
};

private:
/**
* Matches the two orders, the first parameter is taker, the second is maker.
*
* @return which orders were filled (and thus removed)
*/
///@{
match_result_type match( const limit_order_object& taker, const limit_order_object& maker,
const price& trade_price );
match_result_type match_limit_normal_limit( const limit_order_object& taker, const limit_order_object& maker,
Expand Down Expand Up @@ -585,7 +582,7 @@ namespace graphene { namespace chain {
* 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.
* @param The operation to push
* @param op The operation to push
* @param is_virtual Whether the operation is a virtual operation
*
* @return the op_id which can be used to set the result after it has finished being applied.
Expand Down
72 changes: 42 additions & 30 deletions libraries/protocol/include/graphene/protocol/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,37 @@ using private_key_type = fc::ecc::private_key;
using chain_id_type = fc::sha256;
using ratio_type = boost::rational<int32_t>;

/// @note If one of the following bits is set in asset issuer permissions,
/// it means the asset issuer (or owner for bitassets) has the permission to update
/// the corresponding flag, parameters or perform certain actions.
/// * @ref charge_market_fee
/// * @ref white_list
/// * @ref override_authority
/// * @ref transfer_restricted
/// * @ref disable_force_settle
/// * @ref global_settle
/// * @ref disable_confidential
/// * @ref witness_fed_asset
/// * @ref committee_fed_asset
///
/// @note If one of the following bits is set in asset issuer permissions,
/// it means the asset issuer (or owner for bitassets) does NOT have the permission to update
/// the corresponding flag, parameters or perform certain actions.
/// This is to be compatible with old client software.
/// * @ref lock_max_supply
/// * @ref disable_new_supply
/// * @ref disable_mcr_update
/// * @ref disable_icr_update
/// * @ref disable_mssr_update
/// * @ref disable_bsrm_update
/// * @ref disable_collateral_bidding
///
/// @note For @ref disable_mcr_update, @ref disable_icr_update and @ref disable_mssr_update,
/// if one of them is set in issuer permission, and
/// * if the value of the parameter was set by the bitasset owner, it can not be updated,
/// * if no value was set by the owner, the value can still be updated by the feed producers.
enum asset_issuer_permission_flags {
/// @note If one of these bits is set in asset issuer permissions,
/// it means the asset issuer (or owner for bitassets) has the permission to update
/// the corresponding flag, parameters or perform certain actions.
///@{
// permission-enabling bits begin
charge_market_fee = 0x01, ///< market trades in this asset may be charged
white_list = 0x02, ///< accounts must be whitelisted in order to hold or transact this asset
override_authority = 0x04, ///< issuer may transfer asset back to himself
Expand All @@ -163,33 +189,19 @@ enum asset_issuer_permission_flags {
disable_confidential = 0x40, ///< disallow the asset to be used with confidential transactions
witness_fed_asset = 0x80, ///< the bitasset is to be fed by witnesses
committee_fed_asset = 0x100, ///< the bitasset is to be fed by the committee
///@}
/// @note If one of these bits is set in asset issuer permissions,
/// it means the asset issuer (or owner for bitassets) does NOT have the permission to update
/// the corresponding flag, parameters or perform certain actions.
/// This is to be compatible with old client software.
///@{
// permission-enabling bits end
// permission-disabling bits begin
lock_max_supply = 0x200, ///< the max supply of the asset can not be updated
disable_new_supply = 0x400, ///< unable to create new supply for the asset
/// @note These parameters are for issuer permission only.
/// For each parameter, if it is set in issuer permission,
/// it means the bitasset owner can not update the corresponding parameter.
///@{
/// @note For each one of these parameters, if it is set in issuer permission, and
/// * if the value of the parameter was set by the bitasset owner, it can not be updated,
/// * if no value was set by the owner, the value can still be updated by the feed producers.
///@{
disable_mcr_update = 0x800, ///< the bitasset owner can not update MCR, permission only
disable_icr_update = 0x1000, ///< the bitasset owner can not update ICR, permission only
disable_mssr_update = 0x2000, ///< the bitasset owner can not update MSSR, permission only
///@}
disable_bsrm_update = 0x4000, ///< the bitasset owner can not update BSRM, permission only
///@}
disable_collateral_bidding = 0x8000 ///< Can not bid collateral after a global settlement
///@}
// permission-disabling bits end
};

// The bits that can be used in asset issuer permissions for non-UIA assets
/// The bits that can be used in asset issuer permissions for non-UIA assets
const static uint16_t ASSET_ISSUER_PERMISSION_MASK =
charge_market_fee
| white_list
Expand All @@ -207,7 +219,7 @@ const static uint16_t ASSET_ISSUER_PERMISSION_MASK =
| disable_mssr_update
| disable_bsrm_update
| disable_collateral_bidding;
// The "enable" bits for non-UIA assets
/// The "enable" bits for non-UIA assets
const static uint16_t ASSET_ISSUER_PERMISSION_ENABLE_BITS_MASK =
charge_market_fee
| white_list
Expand All @@ -218,7 +230,7 @@ const static uint16_t ASSET_ISSUER_PERMISSION_ENABLE_BITS_MASK =
| disable_confidential
| witness_fed_asset
| committee_fed_asset;
// The "disable" bits for non-UIA assets
/// The "disable" bits for non-UIA assets
const static uint16_t ASSET_ISSUER_PERMISSION_DISABLE_BITS_MASK =
lock_max_supply
| disable_new_supply
Expand All @@ -227,7 +239,7 @@ const static uint16_t ASSET_ISSUER_PERMISSION_DISABLE_BITS_MASK =
| disable_mssr_update
| disable_bsrm_update
| disable_collateral_bidding;
// The bits that can be used in asset issuer permissions for UIA assets
/// The bits that can be used in asset issuer permissions for UIA assets
const static uint16_t UIA_ASSET_ISSUER_PERMISSION_MASK =
charge_market_fee
| white_list
Expand All @@ -236,26 +248,26 @@ const static uint16_t UIA_ASSET_ISSUER_PERMISSION_MASK =
| disable_confidential
| lock_max_supply
| disable_new_supply;
// The bits that can be used in asset issuer permissions for UIA assets before hf48/75
/// The bits that can be used in asset issuer permissions for UIA assets before hf48/75
const static uint16_t DEFAULT_UIA_ASSET_ISSUER_PERMISSION =
charge_market_fee
| white_list
| override_authority
| transfer_restricted
| disable_confidential;
// The bits that can be used in asset issuer permissions for non-UIA assets but not for UIA assets
/// The bits that can be used in asset issuer permissions for non-UIA assets but not for UIA assets
const static uint16_t NON_UIA_ONLY_ISSUER_PERMISSION_MASK =
ASSET_ISSUER_PERMISSION_MASK ^ UIA_ASSET_ISSUER_PERMISSION_MASK;
// The bits that can be used in asset issuer permissions but can not be used in flags
/// The bits that can be used in asset issuer permissions but can not be used in flags
const static uint16_t PERMISSION_ONLY_MASK =
global_settle
| disable_mcr_update
| disable_icr_update
| disable_mssr_update
| disable_bsrm_update;
// The bits that can be used in flags for non-UIA assets
/// The bits that can be used in flags for non-UIA assets
const static uint16_t VALID_FLAGS_MASK = ASSET_ISSUER_PERMISSION_MASK & (uint16_t)(~PERMISSION_ONLY_MASK);
// the bits that can be used in flags for UIA assets
/// the bits that can be used in flags for UIA assets
const static uint16_t UIA_VALID_FLAGS_MASK = UIA_ASSET_ISSUER_PERMISSION_MASK;

enum reserved_spaces {
Expand Down
2 changes: 1 addition & 1 deletion libraries/wallet/operation_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ std::string operation_result_printer::operator()(const void_result& x) const
return "";
}

std::string operation_result_printer::operator()(const object_id_type& oid) const
std::string operation_result_printer::operator()(const graphene::protocol::object_id_type& oid) const
{
return std::string(oid);
}
Expand Down

0 comments on commit e882a8b

Please sign in to comment.