当前位置: 首页>>代码示例>>C++>>正文


C++ asset::get_rounded_amount方法代码示例

本文整理汇总了C++中asset::get_rounded_amount方法的典型用法代码示例。如果您正苦于以下问题:C++ asset::get_rounded_amount方法的具体用法?C++ asset::get_rounded_amount怎么用?C++ asset::get_rounded_amount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在asset的用法示例。


在下文中一共展示了asset::get_rounded_amount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: add_output_delegate_votes

 void block_evaluation_state::add_output_delegate_votes( int32_t did, const asset& votes )
 {
    auto itr = _output_votes.find(did);
    if( itr == _output_votes.end() )
       _output_votes[did] = votes.get_rounded_amount();
    else
       itr->second += votes.get_rounded_amount();
 }
开发者ID:suykerbuyk,项目名称:bitshares_toolkit,代码行数:8,代码来源:transaction_validator.cpp

示例2: find_unused_sig_output

uint16_t trx_validation_state::find_unused_sig_output( const address& owner, const asset& bal )
{
  auto rounded_amount = asset(bal.get_rounded_amount(),bal.unit);
  ilog( "find unused sig output ${o}  ${bal}", ("o", owner)("bal",bal) );
  for( uint32_t i = 0; i < trx.outputs.size(); ++i )
  {
     if( used_outputs.find(i) == used_outputs.end() )
     {
        ilog( "out: ${i}", ("i",trx.outputs[i]) );
        if( trx.outputs[i].claim_func == claim_by_signature )
        {
           ilog( "amount: ${i} ==? ${r} ", ("i",trx.outputs[i].get_amount())("r",rounded_amount) );
           ilog( "round down amount: ${i} ==? ${r} ", ("i",trx.outputs[i].amount/5)("r",rounded_amount.amount.high_bits()/5) );
           if( trx.outputs[i].amount/5 == rounded_amount.amount.high_bits()/5 && trx.outputs[i].unit == bal.unit )
           {
              if( trx.outputs[i].as<claim_by_signature_output>().owner == owner )
              {
                 return i;
              }
           }
        }
     }
  }
  return output_not_found;
}
开发者ID:Doken-Tokuyama,项目名称:BitShares,代码行数:25,代码来源:trx_validation_state.cpp

示例3: add_required_fees

 void transaction_evaluation_state::add_required_fees( asset a )
 {
     auto itr = total.find( a.unit );
     if( itr == total.end() ) total[a.unit].required_fees = a.get_rounded_amount();
     else itr->second.required_fees += a.get_rounded_amount();
 }
开发者ID:suykerbuyk,项目名称:bitshares_toolkit,代码行数:6,代码来源:transaction_validator.cpp

示例4: add_output_asset

 void transaction_evaluation_state::add_output_asset( asset a )
 {
     auto itr = total.find( a.unit );
     if( itr == total.end() ) total[a.unit].out = a.get_rounded_amount();
     else itr->second.out += a.get_rounded_amount();
 }
开发者ID:suykerbuyk,项目名称:bitshares_toolkit,代码行数:6,代码来源:transaction_validator.cpp

示例5:

 trx_output( const ClaimType& t, const asset& a )
 :amount(a.get_rounded_amount()),unit(a.unit)
 {
    claim_func = ClaimType::type;
    claim_data = fc::raw::pack(t);
 }
开发者ID:GocoinerGCR,项目名称:GoCoineR,代码行数:6,代码来源:transaction.hpp


注:本文中的asset::get_rounded_amount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。