Example #1
0
 void escrow_dispute_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( from ) );
    FC_ASSERT( is_valid_account_name( to ) );
    FC_ASSERT( is_valid_account_name( who ) );
    FC_ASSERT( who == from || who == to );
 }
Example #2
0
 void report_over_production_operation::validate()const {
    FC_ASSERT( is_valid_account_name( reporter ) );
    FC_ASSERT( is_valid_account_name( first_block.witness ) );
    FC_ASSERT( first_block.witness   == second_block.witness );
    FC_ASSERT( first_block.timestamp == second_block.timestamp );
    FC_ASSERT( first_block.signee()  == second_block.signee() );
 }
Example #3
0
 void transfer_to_vesting_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( from ), "From account name invalid" );
    FC_ASSERT( is_asset_type( amount, STEEM_SYMBOL ), "Amount must be STEEM" );
    if ( !to.empty() ) FC_ASSERT( is_valid_account_name( to ), "To account name invalid" );
    FC_ASSERT( amount > asset( 0, STEEM_SYMBOL ), "Must transfer a nonzero amount" );
 }
Example #4
0
 void vote_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( voter ), "Voter account name invalid" );
    FC_ASSERT( is_valid_account_name( author ), "Author account name invalid" );\
    FC_ASSERT( abs(weight) <= STEEMIT_100_PERCENT, "Weight is not a STEEMIT percentage" );
    validate_permlink( permlink );
 }
Example #5
0
 void account_witness_proxy_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( account ) );
    if( proxy.size() )
       FC_ASSERT( is_valid_account_name( proxy ) );
    FC_ASSERT( proxy != account );
 }
Example #6
0
 void transfer_operation::validate() const
 { try {
    FC_ASSERT( is_valid_account_name( from ), "Invalid 'from' account name" );
    FC_ASSERT( is_valid_account_name( to ), "Invalid 'to' account name" );
    FC_ASSERT( amount.amount > 0, "Cannot transfer a negative amount (aka: stealing)" );
    FC_ASSERT( memo.size() < STEEMIT_MAX_MEMO_SIZE, "Memo is too large" );
    FC_ASSERT( fc::is_utf8( memo ), "Memo is not UTF8" );
 } FC_CAPTURE_AND_RETHROW( (*this) ) }
Example #7
0
 void escrow_release_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( from ) );
    FC_ASSERT( is_valid_account_name( to ) );
    FC_ASSERT( is_valid_account_name( who ) );
    FC_ASSERT( amount.amount > 0 );
    FC_ASSERT( amount.symbol != VESTS_SYMBOL );
 }
Example #8
0
 void escrow_transfer_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( from ) );
    FC_ASSERT( is_valid_account_name( to ) );
    FC_ASSERT( is_valid_account_name( agent ) );
    FC_ASSERT( fee.amount >= 0 );
    FC_ASSERT( amount.amount >= 0 );
    FC_ASSERT( from != agent && to != agent );
    FC_ASSERT( fee.symbol == amount.symbol );
    FC_ASSERT( amount.symbol != VESTS_SYMBOL );
 }
Example #9
0
 void limit_order_create_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( owner ) );
    FC_ASSERT( ( is_asset_type( amount_to_sell, STEEM_SYMBOL ) && is_asset_type( min_to_receive, SBD_SYMBOL ) )
       || ( is_asset_type( amount_to_sell, SBD_SYMBOL ) && is_asset_type( min_to_receive, STEEM_SYMBOL ) ) );
    (amount_to_sell / min_to_receive).validate();
 }
Example #10
0
 void feed_publish_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( publisher ) );
    FC_ASSERT( ( is_asset_type( exchange_rate.base, STEEM_SYMBOL ) && is_asset_type( exchange_rate.quote, SBD_SYMBOL ) )
       || ( is_asset_type( exchange_rate.base, SBD_SYMBOL ) && is_asset_type( exchange_rate.quote, STEEM_SYMBOL ) ) );
    exchange_rate.validate();
 }
Example #11
0
 void pow_operation::validate()const
 {
    props.validate();
    FC_ASSERT( is_valid_account_name( worker_account ) );
    FC_ASSERT( work_input() == work.input );
    work.validate();
 }
Example #12
0
 void convert_operation::validate()const {
    FC_ASSERT( is_valid_account_name( owner ) );
    /// only allow conversion from SBD to STEEM, allowing the opposite can enable traders to abuse
    /// market fluxuations through converting large quantities without moving the price.
    FC_ASSERT( is_asset_type( amount, SBD_SYMBOL ) );
    FC_ASSERT( amount.amount > 0 );
 }
Example #13
0
 void witness_update_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( owner ), "Owner account name invalid" );
    FC_ASSERT( url.size() > 0, "URL size must be greater than 0" );
    FC_ASSERT( fc::is_utf8( url ) );
    FC_ASSERT( fee >= asset( 0, STEEM_SYMBOL ) );
    props.validate();
 }
Example #14
0
 void comment_options_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( author ), "Author name invalid" );
    FC_ASSERT( percent_steem_dollars <= STEEMIT_100_PERCENT );
    FC_ASSERT( max_accepted_payout.symbol == SBD_SYMBOL );
    FC_ASSERT( max_accepted_payout.amount.value >= 0 );
    validate_permlink( permlink );
 }
Example #15
0
   void comment_operation::validate() const
   {
      FC_ASSERT( title.size() < 256, "Title larger than size limit" );
      FC_ASSERT( fc::is_utf8( title ), "Title not formatted in UTF8" );
      FC_ASSERT( body.size() > 0, "Body is empty" );
      FC_ASSERT( fc::is_utf8( body ), "Body not formatted in UTF8" );


      FC_ASSERT( !parent_author.size() || is_valid_account_name( parent_author ), "Parent author name invalid" );
      FC_ASSERT( is_valid_account_name( author ), "Author name invalid" );
      validate_permlink( parent_permlink );
      validate_permlink( permlink );

      if( json_metadata.size() > 0 )
      {
         FC_ASSERT( fc::json::is_valid(json_metadata), "JSON Metadata not valid JSON" );
      }
   }
Example #16
0
 void recover_account_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( account_to_recover ) );
    FC_ASSERT( !( new_owner_authority == recent_owner_authority) );
    FC_ASSERT( !new_owner_authority.is_impossible() );
    FC_ASSERT( !recent_owner_authority.is_impossible() );
    FC_ASSERT( new_owner_authority.weight_threshold );
    new_owner_authority.validate();
    recent_owner_authority.validate();
 }
Example #17
0
   void limit_order_create2_operation::validate()const
   {
      FC_ASSERT( is_valid_account_name( owner ) );
      FC_ASSERT( amount_to_sell.symbol == exchange_rate.base.symbol );
      exchange_rate.validate();

      FC_ASSERT( ( is_asset_type( amount_to_sell, STEEM_SYMBOL ) && is_asset_type( exchange_rate.quote, SBD_SYMBOL ) ) ||
                 ( is_asset_type( amount_to_sell, SBD_SYMBOL ) && is_asset_type( exchange_rate.quote, STEEM_SYMBOL ) ) );

      FC_ASSERT( (amount_to_sell * exchange_rate).amount > 0 ); // must not round to 0
   }
Example #18
0
   void account_update_operation::validate() const
   {
      FC_ASSERT( is_valid_account_name( account ) );
      if( owner )
         owner->validate();
      if (active)
         active->validate();

      if ( json_metadata.size() > 0 )
      {
         FC_ASSERT( fc::is_utf8(json_metadata), "JSON Metadata not formatted in UTF8" );
         FC_ASSERT( fc::json::is_valid(json_metadata), "JSON Metadata not valid JSON" );
      }
   }
Example #19
0
 void prove_authority_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( challenged ), "challenged account name invalid" );
 }
Example #20
0
 void delete_comment_operation::validate()const
 {
    validate_permlink( permlink );
    FC_ASSERT( is_valid_account_name( author ) );
 }
Example #21
0
 void withdraw_vesting_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( account ), "Account name invalid" );
    FC_ASSERT( is_asset_type( vesting_shares, VESTS_SYMBOL), "Amount must be VESTS"  );
 }
Example #22
0
 void set_withdraw_vesting_route_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( from_account ), "Account name invalid" );
    FC_ASSERT( is_valid_account_name( to_account ), "Account name invalid" );
    FC_ASSERT( 0 <= percent && percent <= STEEMIT_100_PERCENT, "Percent must be valid steemit percent" );
 }
Example #23
0
 void change_recovery_account_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( account_to_recover ) );
    FC_ASSERT( is_valid_account_name( new_recovery_account ) );
 }
Example #24
0
 void account_witness_vote_operation::validate() const
 {
    FC_ASSERT( is_valid_account_name( account ), "Account ${a}", ("a",account)  );
    FC_ASSERT( is_valid_account_name( witness ) );
 }
Example #25
0
 void request_account_recovery_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( recovery_account ) );
    FC_ASSERT( is_valid_account_name( account_to_recover ) );
    new_owner_authority.validate();
 }
Example #26
0
inline void validate_account_name( const string& name )
{
   FC_ASSERT( is_valid_account_name( name ), "Account name ${n} is invalid", ("n", name) );
}
Example #27
0
 void limit_order_cancel_operation::validate()const
 {
    FC_ASSERT( is_valid_account_name( owner ) );
 }