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


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怎么用?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) ) }
开发者ID:NameShares,项目名称:nameshares,代码行数:29,代码来源:auction_operations.cpp


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