Skip to content

Commit

Permalink
Api fixes, typo, black (#75)
Browse files Browse the repository at this point in the history
- Return correct api response
- Fix typo in `README.md`
- `black`
  • Loading branch information
kchojn authored Jan 4, 2022
1 parent 0081429 commit 3f36434
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Here is a list of steps to recreate local environment on <b>Ubuntu</b> 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:
Expand Down
2 changes: 1 addition & 1 deletion ethtx_ce/api/endpoints/semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 3 additions & 3 deletions ethtx_ce/api/endpoints/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 1 addition & 2 deletions ethtx_ce/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ProductionConfig(Config):
PROPAGATE_EXCEPTIONS = True



class StagingConfig(Config):
"""Staging Config."""

Expand All @@ -54,11 +53,11 @@ class StagingConfig(Config):
TESTING = False
PROPAGATE_EXCEPTIONS = True


class DevelopmentConfig(Config):
"""Development Config."""

ENV = "development"
FLASK_DEBUG = True
TESTING = True
PROPAGATE_EXCEPTIONS = True

2 changes: 1 addition & 1 deletion ethtx_ce/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self):


class EmptyResponseError(RequestError):
""" Response is empty."""
"""Response is empty."""

def __init__(self, msg: str):
super().__init__(msg)
Expand Down
4 changes: 2 additions & 2 deletions ethtx_ce/frontend/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3f36434

Please sign in to comment.