Skip to content

Commit

Permalink
Merge pull request #2206 from bitshares/update-error-messages
Browse files Browse the repository at this point in the history
Update error messages
  • Loading branch information
abitmore authored Jun 23, 2020
2 parents e22436f + 2653c32 commit 099c842
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions libraries/chain/market_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,16 @@ object_id_type call_order_update_evaluator::do_apply(const call_order_update_ope
// after BSIP77, CR of the new/updated position is required to be above max(ICR,MCR).
// The `current_initial_collateralization` variable has been initialized according to the logic,
// so we directly use it here.
FC_ASSERT( ( !before_core_hardfork_1270
bool check = ( !before_core_hardfork_1270
&& call_obj->collateralization() > _bitasset_data->current_initial_collateralization )
|| ( before_core_hardfork_1270
&& ~call_obj->call_price < _bitasset_data->current_feed.settlement_price )
|| ( old_collateralization.valid() && call_obj->debt <= *old_debt
&& call_obj->collateralization() > *old_collateralization ),
"Can only increase collateral ratio without increasing debt if would trigger a margin call that "
"cannot be fully filled",
&& call_obj->collateralization() > *old_collateralization );
FC_ASSERT( check,
"Can only increase collateral ratio without increasing debt when the debt position's "
"collateral ratio is lower than required initial collateral ratio (ICR), "
"if not to trigger a margin call that be fully filled immediately",
("old_debt", old_debt)
("new_debt", call_obj->debt)
("old_collateralization", old_collateralization)
Expand Down
6 changes: 3 additions & 3 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ account_object wallet_api::get_account(string account_name_or_id) const

extended_asset_object wallet_api::get_asset(string asset_name_or_id) const
{
auto a = my->find_asset(asset_name_or_id);
FC_ASSERT(a);
return *a;
auto found_asset = my->find_asset(asset_name_or_id);
FC_ASSERT( found_asset, "Unable to find asset '${a}'", ("a",asset_name_or_id) );
return *found_asset;
}

asset_bitasset_data_object wallet_api::get_bitasset_data(string asset_name_or_id) const
Expand Down

0 comments on commit 099c842

Please sign in to comment.