예제 #1
0
    def txresult(self, conf):
        """Query transaction result using given transaction hash.

        :param conf: txresult command configuration.
        :return: result of query.
        """
        icon_client = IconClient(conf['uri'])

        response = icon_client.send(
            IconJsonrpc.getTransactionResult(conf['hash']))

        if "error" in response:
            print('Got an error response')
            print(
                f"Can not get transaction result \n{json.dumps(response, indent=4)}"
            )
        else:
            print(f"Transaction result: {json.dumps(response, indent=4)}")

        return response
예제 #2
0
 def test_getTransactionResult(self):
     txHash = '0x43de4f25a41cb8cd09b0478300ce8da24191f1602e54b6db2ce6274311556164'
     request = IconJsonrpc.getTransactionResult(txHash)
     self.check_jsonschema_validation(request=request)