From 6d3d632ecc0c6ceb85875bfbb27655f74d0be260 Mon Sep 17 00:00:00 2001 From: zakir <80246097+zakir-code@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:53:23 +0800 Subject: [PATCH] use flake8 format code --- fxsdk/client/grpc_client.py | 7 +++---- fxsdk/wallet/address.py | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fxsdk/client/grpc_client.py b/fxsdk/client/grpc_client.py index 463ca4d..901543a 100644 --- a/fxsdk/client/grpc_client.py +++ b/fxsdk/client/grpc_client.py @@ -13,9 +13,8 @@ from fxsdk.x.cosmos.auth.v1beta1.query_pb2 import QueryAccountRequest, Bech32PrefixRequest, QueryModuleAccountsRequest from fxsdk.x.cosmos.auth.v1beta1.query_pb2_grpc import QueryStub as AuthQuery from fxsdk.x.cosmos.bank.v1beta1.bank_pb2 import Supply -from fxsdk.x.cosmos.bank.v1beta1.tx_pb2 import MsgSend -from fxsdk.x.cosmos.bank.v1beta1.query_pb2 import QueryBalanceRequest, QueryAllBalancesRequest, QueryTotalSupplyRequest, \ - QuerySupplyOfRequest +from fxsdk.x.cosmos.bank.v1beta1.query_pb2 import (QueryBalanceRequest, QueryAllBalancesRequest, + QueryTotalSupplyRequest, QuerySupplyOfRequest) from fxsdk.x.cosmos.bank.v1beta1.query_pb2_grpc import QueryStub as BankQuery from fxsdk.x.cosmos.base.abci.v1beta1.abci_pb2 import GasInfo, TxResponse from fxsdk.x.cosmos.base.tendermint.v1beta1.query_pb2 import GetBlockByHeightRequest, GetLatestBlockRequest, \ @@ -186,6 +185,6 @@ def wait_mint_tx(self, tx_hash: str) -> TxResponse: try: response = self.query_tx(tx_hash) return response.tx_response - except: + except grpc.RpcError: continue raise Exception("not found tx") diff --git a/fxsdk/wallet/address.py b/fxsdk/wallet/address.py index b32c7ff..afc30a4 100644 --- a/fxsdk/wallet/address.py +++ b/fxsdk/wallet/address.py @@ -6,10 +6,10 @@ class Address: def __init__(self, addr, prefix: str = DEFAULT_BECH32_PREFIX): self._prefix = prefix - if type(addr) == str: + if type(addr) is str: _, data = bech32.bech32_decode(addr) self._data = data - elif type(addr) == bytes: + elif type(addr) is bytes: self._data = bech32.convertbits(addr, 8, 5) else: raise Exception('invalid address')