コード例 #1
0
 void account_witness_vote_operation::validate() const
 {
    validate_account_name( account );
    validate_account_name( witness );
 }
コード例 #2
0
 void withdraw_vesting_operation::validate() const
 {
    validate_account_name( account );
    FC_ASSERT( is_asset_type( vesting_shares, VESTS_SYMBOL), "Amount must be VESTS"  );
 }
コード例 #3
0
 void set_withdraw_vesting_route_operation::validate() const
 {
    validate_account_name( from_account );
    validate_account_name( to_account );
    FC_ASSERT( 0 <= percent && percent <= STEEMIT_100_PERCENT, "Percent must be valid steemit percent" );
 }
コード例 #4
0
 void challenge_authority_operation::validate()const
  {
    validate_account_name( challenger );
    validate_account_name( challenged );
    FC_ASSERT( challenged != challenger, "cannot challenge yourself" );
 }
コード例 #5
0
 void prove_authority_operation::validate()const
 {
    validate_account_name( challenged );
 }
コード例 #6
0
 void decline_voting_rights_operation::validate()const
 {
    validate_account_name( account );
 }
コード例 #7
0
 void delete_comment_operation::validate()const
 {
    validate_permlink( permlink );
    validate_account_name( author );
 }
コード例 #8
0
 void change_recovery_account_operation::validate()const
 {
    validate_account_name( account_to_recover );
    validate_account_name( new_recovery_account );
 }
コード例 #9
0
 void cancel_transfer_from_savings_operation::validate()const {
    validate_account_name( from );
 }
コード例 #10
0
 void request_account_recovery_operation::validate()const
 {
    validate_account_name( recovery_account );
    validate_account_name( account_to_recover );
    new_owner_authority.validate();
 }
コード例 #11
0
 void limit_order_cancel_operation::validate()const
 {
    validate_account_name( owner );
 }
コード例 #12
0
 void pow2::validate()const
 {
    validate_account_name( input.worker_account );
    pow2 tmp; tmp.create( input.prev_block, input.worker_account, input.nonce );
    FC_ASSERT( pow_summary == tmp.pow_summary, "reported work does not match calculated work" );
 }
コード例 #13
0
   void witness_set_properties_operation::validate() const
   {
      validate_account_name( owner );

      // current signing key must be present
      FC_ASSERT( props.find( "key" ) != props.end(), "No signing key provided" );

      auto itr = props.find( "account_creation_fee" );
      if( itr != props.end() )
      {
         asset account_creation_fee;
         fc::raw::unpack_from_vector( itr->second, account_creation_fee );
         FC_ASSERT( account_creation_fee.symbol == STEEM_SYMBOL, "account_creation_fee must be in STEEM" );
         FC_ASSERT( account_creation_fee.amount >= STEEM_MIN_ACCOUNT_CREATION_FEE , "account_creation_fee smaller than minimum account creation fee" );
      }

      itr = props.find( "maximum_block_size" );
      if( itr != props.end() )
      {
         uint32_t maximum_block_size;
         fc::raw::unpack_from_vector( itr->second, maximum_block_size );
         FC_ASSERT( maximum_block_size >= STEEM_MIN_BLOCK_SIZE_LIMIT, "maximum_block_size smaller than minimum max block size" );
      }

      itr = props.find( "sbd_interest_rate" );
      if( itr != props.end() )
      {
         uint16_t sbd_interest_rate;
         fc::raw::unpack_from_vector( itr->second, sbd_interest_rate );
         FC_ASSERT( sbd_interest_rate >= 0, "sbd_interest_rate must be positive" );
         FC_ASSERT( sbd_interest_rate <= STEEM_100_PERCENT, "sbd_interest_rate must not exceed 100%" );
      }

      itr = props.find( "new_signing_key" );
      if( itr != props.end() )
      {
         public_key_type signing_key;
         fc::raw::unpack_from_vector( itr->second, signing_key );
         FC_UNUSED( signing_key ); // This tests the deserialization of the key
      }

      itr = props.find( "sbd_exchange_rate" );
      if( itr != props.end() )
      {
         price sbd_exchange_rate;
         fc::raw::unpack_from_vector( itr->second, sbd_exchange_rate );
         FC_ASSERT( ( is_asset_type( sbd_exchange_rate.base, SBD_SYMBOL ) && is_asset_type( sbd_exchange_rate.quote, STEEM_SYMBOL ) ),
            "Price feed must be a STEEM/SBD price" );
         sbd_exchange_rate.validate();
      }

      itr = props.find( "url" );
      if( itr != props.end() )
      {
         std::string url;
         fc::raw::unpack_from_vector< std::string >( itr->second, url );

         FC_ASSERT( url.size() <= STEEM_MAX_WITNESS_URL_LENGTH, "URL is too long" );
         FC_ASSERT( url.size() > 0, "URL size must be greater than 0" );
         FC_ASSERT( fc::is_utf8( url ), "URL is not valid UTF8" );
      }

      itr = props.find( "account_subsidy_limit" );
      if( itr != props.end() )
      {
         uint32_t account_subsidy_limit;
         fc::raw::unpack_from_vector( itr->second, account_subsidy_limit ); // Checks that the value can be deserialized
         FC_UNUSED( account_subsidy_limit );
      }
   }
コード例 #14
0
ファイル: sps_operations.cpp プロジェクト: dbarobin/steem
void remove_proposal_operation::validate() const
{
   validate_account_name(proposal_owner);
   FC_ASSERT(proposal_ids.empty() == false);
   FC_ASSERT(proposal_ids.size() <= STEEM_PROPOSAL_MAX_IDS_NUMBER);
}