本文整理汇总了C++中transaction_evaluation_state::check_update_permission方法的典型用法代码示例。如果您正苦于以下问题:C++ transaction_evaluation_state::check_update_permission方法的具体用法?C++ transaction_evaluation_state::check_update_permission怎么用?C++ transaction_evaluation_state::check_update_permission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transaction_evaluation_state
的用法示例。
在下文中一共展示了transaction_evaluation_state::check_update_permission方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluate
void user_auction_claim_operation::evaluate( transaction_evaluation_state& eval_state )
{ try {
FC_ASSERT( !"This operation is not enabled yet!" );
auto chain = eval_state._current_state;
auto obj = chain->get_object_record( this->auction_id );
FC_ASSERT( obj.valid(), "No such auction." );
auto auction = obj->as<user_auction_record>();
FC_ASSERT( auction.is_complete( *chain ), "Auction is not over yet." );
if( this->claim_balance )
{
FC_ASSERT( NOT auction.balance_claimed,
"Those auction winnings have already been claimed." );
eval_state.check_update_permission( auction.beneficiary );
eval_state.add_balance( auction.previous_bid );
auction.balance_claimed = true;
}
if( this->claim_object ) // set the item's owner to the winner
{
FC_ASSERT( NOT auction.object_claimed, "That object has already been claimed." );
eval_state.check_update_permission( auction.previous_bidder );
auto item = chain->get_object_record( auction.item );
FC_ASSERT( item->owner_object == auction._id, "An auction was being held for an item owned by someone else?");
item->owner_object = auction.previous_bidder;
chain->store_object_record( *item );
auction.object_claimed = true;
}
chain->store_object_record( object_record( auction ) );
} FC_CAPTURE_AND_RETHROW( (eval_state)(*this) ) }