From 38f31c9cc0af9c4621120adbfaeca1a95d528800 Mon Sep 17 00:00:00 2001 From: Omkar Bhat Date: Thu, 25 Mar 2021 07:49:21 -0600 Subject: [PATCH] Try without raising --- tendermint_utils/rpc.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tendermint_utils/rpc.py b/tendermint_utils/rpc.py index 9e13c0b..e43185a 100644 --- a/tendermint_utils/rpc.py +++ b/tendermint_utils/rpc.py @@ -31,15 +31,12 @@ class TendermintRPC: print(f'An error occured retrieving the results of block height: {err}') def get_transactions_by_block(self, height, limit=None, page=1): - try: - if limit is not None: - response = requests.get(self.node_url + '/tx_search?query=\"tx.height=' + str(height) + '\"&prove=true&per_page=' + str(limit) + '&page=' + str(page)) - else: - response = requests.get(self.node_url + '/tx_search?query=\"tx.height=' + str(height) + '\"&prove=true&page=' + str(page)) - data = response.json() - return data['result'] - except Exception as err: - print(f'An error occured retrieving the transactions in block: {err}') + if limit is not None: + response = requests.get(self.node_url + '/tx_search?query=\"tx.height=' + str(height) + '\"&prove=true&per_page=' + str(limit) + '&page=' + str(page)) + else: + response = requests.get(self.node_url + '/tx_search?query=\"tx.height=' + str(height) + '\"&prove=true&page=' + str(page)) + data = response.json() + return data['result'] def get_transactions_by_hash(self, tx_hash, hex_prefix=False): try: