rest_server.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:loopchain 作者: theloopkr 项目源码 文件源码
def get(self):
        logging.debug('transaction result')
        args = ServerComponents().parser.parse_args()
        logging.debug('tx_hash : ' + args['hash'])
        channel_name = get_channel_name_from_args(args)
        response = ServerComponents().get_invoke_result(args['hash'], channel_name)
        verify_result = dict()
        verify_result['response_code'] = str(response.response_code)
        if len(response.result) is not 0:
            try:
                result = json.loads(response.result)
                result['jsonrpc'] = '2.0'
                verify_result['response'] = result
            except json.JSONDecodeError as e:
                logging.warning("your data is not json, your data(" + str(response.data) + ")")
                verify_result['response_code'] = message_code.Response.fail
        else :
            verify_result['response_code'] = str(message_code.Response.fail)
        return verify_result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号