本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}