diff --git a/README.md b/README.md index aced53e..1f6be2b 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Here is a list of steps to recreate local environment on Ubuntu distribut ENV=development ``` 4. Run `pipenv run python3 wsgi.py` for `make run-local`. This will setup new server on host 0.0.0.0 port 5000. -5. Now `ethtx_ce` should be accessible thorugh link [http://localhost:5000](http://localhost:5000) +5. Now `ethtx_ce` should be accessible through link [http://localhost:5000](http://localhost:5000) Use can also provided `docker-compose` for running this locally: diff --git a/ethtx_ce/api/endpoints/semantics.py b/ethtx_ce/api/endpoints/semantics.py index a2ea7c8..b4d6c79 100644 --- a/ethtx_ce/api/endpoints/semantics.py +++ b/ethtx_ce/api/endpoints/semantics.py @@ -27,4 +27,4 @@ def read_raw_semantic(address: str, chain_id: Optional[str] = None): raw_semantics = current_app.ethtx.semantics.get_raw_semantics( chain_id=chain_id, address=address ) - return raw_semantics + return raw_semantics.dict() diff --git a/ethtx_ce/api/endpoints/transactions.py b/ethtx_ce/api/endpoints/transactions.py index f7c81be..1f9f712 100644 --- a/ethtx_ce/api/endpoints/transactions.py +++ b/ethtx_ce/api/endpoints/transactions.py @@ -33,7 +33,7 @@ def read_decoded_transaction(tx_hash: str, chain_id: Optional[str] = None): decoded_transaction = current_app.ethtx.decoders.decode_transaction( chain_id=chain_id, tx_hash=tx_hash ) - decoded_transaction.metadata.timestamp = decoded_transaction.metadata.timestamp.strftime( - "%Y-%m-%d %H:%M:%S" + decoded_transaction.metadata.timestamp = ( + decoded_transaction.metadata.timestamp.strftime("%Y-%m-%d %H:%M:%S") ) - return decoded_transaction + return decoded_transaction.dict() diff --git a/ethtx_ce/config.py b/ethtx_ce/config.py index 312931c..cc23c9d 100644 --- a/ethtx_ce/config.py +++ b/ethtx_ce/config.py @@ -45,7 +45,6 @@ class ProductionConfig(Config): PROPAGATE_EXCEPTIONS = True - class StagingConfig(Config): """Staging Config.""" @@ -54,6 +53,7 @@ class StagingConfig(Config): TESTING = False PROPAGATE_EXCEPTIONS = True + class DevelopmentConfig(Config): """Development Config.""" @@ -61,4 +61,3 @@ class DevelopmentConfig(Config): FLASK_DEBUG = True TESTING = True PROPAGATE_EXCEPTIONS = True - diff --git a/ethtx_ce/exceptions.py b/ethtx_ce/exceptions.py index 729e2c0..878dd56 100644 --- a/ethtx_ce/exceptions.py +++ b/ethtx_ce/exceptions.py @@ -83,7 +83,7 @@ def __init__(self): class EmptyResponseError(RequestError): - """ Response is empty.""" + """Response is empty.""" def __init__(self, msg: str): super().__init__(msg) diff --git a/ethtx_ce/frontend/transactions.py b/ethtx_ce/frontend/transactions.py index 4d840ac..e42b135 100644 --- a/ethtx_ce/frontend/transactions.py +++ b/ethtx_ce/frontend/transactions.py @@ -33,8 +33,8 @@ def read_decoded_transaction( decoded_transaction = current_app.ethtx.decoders.decode_transaction( chain_id=chain_id, tx_hash=tx_hash ) - decoded_transaction.metadata.timestamp = decoded_transaction.metadata.timestamp.strftime( - "%Y-%m-%d %H:%M:%S" + decoded_transaction.metadata.timestamp = ( + decoded_transaction.metadata.timestamp.strftime("%Y-%m-%d %H:%M:%S") ) return show_transaction_page(decoded_transaction)