2020-06-15 12:12:56 +00:00
|
|
|
#include <graphene/chain/protocol/offer.hpp>
|
|
|
|
|
|
2020-06-19 15:02:03 +00:00
|
|
|
namespace graphene
|
2020-06-15 12:12:56 +00:00
|
|
|
{
|
2020-07-06 16:51:18 +00:00
|
|
|
namespace chain
|
2020-06-19 15:02:03 +00:00
|
|
|
{
|
2020-07-06 16:51:18 +00:00
|
|
|
share_type offer_operation::calculate_fee(const fee_parameters_type &schedule) const
|
|
|
|
|
{
|
|
|
|
|
share_type core_fee_required = schedule.fee;
|
|
|
|
|
return core_fee_required;
|
|
|
|
|
}
|
2020-06-15 12:12:56 +00:00
|
|
|
|
2020-07-06 16:51:18 +00:00
|
|
|
void offer_operation::validate() const
|
|
|
|
|
{
|
|
|
|
|
FC_ASSERT(item_ids.size() > 0);
|
|
|
|
|
FC_ASSERT(fee.amount >= 0);
|
|
|
|
|
FC_ASSERT(minimum_price.asset_id == maximum_price.asset_id);
|
|
|
|
|
FC_ASSERT(minimum_price.amount >= 0 && maximum_price.amount > 0);
|
|
|
|
|
FC_ASSERT(maximum_price >= minimum_price);
|
|
|
|
|
}
|
2020-06-15 12:12:56 +00:00
|
|
|
|
2020-07-06 16:51:18 +00:00
|
|
|
share_type bid_operation::calculate_fee(const fee_parameters_type &schedule) const
|
|
|
|
|
{
|
|
|
|
|
share_type core_fee_required = schedule.fee;
|
|
|
|
|
return core_fee_required;
|
|
|
|
|
}
|
2020-06-15 12:12:56 +00:00
|
|
|
|
2020-07-06 16:51:18 +00:00
|
|
|
void bid_operation::validate() const
|
|
|
|
|
{
|
|
|
|
|
FC_ASSERT(fee.amount.value >= 0);
|
|
|
|
|
FC_ASSERT(bid_price.amount.value >= 0);
|
|
|
|
|
}
|
2020-06-15 12:12:56 +00:00
|
|
|
|
2020-07-06 16:51:18 +00:00
|
|
|
void finalize_offer_operation::validate() const
|
|
|
|
|
{
|
|
|
|
|
FC_ASSERT(fee.amount.value >= 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
share_type finalize_offer_operation::calculate_fee(const fee_parameters_type &k) const
|
|
|
|
|
{
|
|
|
|
|
share_type core_fee_required = k.fee;
|
|
|
|
|
return core_fee_required;
|
|
|
|
|
}
|
2020-06-15 12:12:56 +00:00
|
|
|
|
2020-07-06 16:51:18 +00:00
|
|
|
} // namespace chain
|
2020-06-19 15:02:03 +00:00
|
|
|
} // namespace graphene
|