peerplays_migrated/libraries/chain/protocol/market.cpp
Daniel Larimer baf5531238 Refactored chain library
- remove circular dependency with fee_schedule
- unitiy build db_* as database.cpp
- move protocol definitions in separate directory
- combined some objects/evaluators
- combined limit/call evaluator/objects into market_evaluator.*
2015-07-08 16:39:23 -04:00

26 lines
768 B
C++

/* Copyright (C) Cryptonomex, Inc - All Rights Reserved **/
#include <graphene/chain/protocol/market.hpp>
namespace graphene { namespace chain {
void limit_order_create_operation::validate()const
{
FC_ASSERT( amount_to_sell.asset_id != min_to_receive.asset_id );
FC_ASSERT( fee.amount >= 0 );
FC_ASSERT( amount_to_sell.amount > 0 );
FC_ASSERT( min_to_receive.amount > 0 );
}
void limit_order_cancel_operation::validate()const
{
FC_ASSERT( fee.amount >= 0 );
}
void call_order_update_operation::validate()const
{ try {
FC_ASSERT( fee.amount >= 0 );
FC_ASSERT( delta_collateral.asset_id != delta_debt.asset_id );
FC_ASSERT( delta_collateral.amount != 0 || delta_debt.amount != 0 );
} FC_CAPTURE_AND_RETHROW((*this)) }
} } // graphene::chain