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: