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
评论列表
文章目录