Skip to content

Commit

Permalink
Merge pull request EthTx#70 from EthTx/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Piotr Rudnik authored Dec 23, 2021
2 parents 28ccffb + 7241c8b commit 5dd8e40
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 76 deletions.
3 changes: 3 additions & 0 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ MAINNET_NODE_URL=https://geth-erigon-node:8545
# KOVAN_NODE_URL=
# RINKEBY_NODE_URL=

# EthTx supports multiple nodes, if one is unavailable, it will use others. You only need to specify them with a comma.
# Example: MAINNET_NODE_URL=https://geth-erigon-node:8545,https://geth1-erigon-node:8545

# Etherscan API is used to get contract source code, required for decoding process
# You can get free key here https://etherscan.io/apis
ETHERSCAN_KEY=
Expand Down
28 changes: 18 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file.

## 0.2.8 - 2021-10-29
### Changed
- Updated **README** and **.env_sample** [#67](https://github.com/EthTx/ethtx_ce/pull/67)
- `Web3ConnectionException` is not supported anymore. From now on, a general exception `NodeConnectionException`
is caught for node connection errors [#67](https://github.com/EthTx/ethtx_ce/pull/67)
- Guessed functions and events are detected using the guessed variable in the
model [#67](https://github.com/EthTx/ethtx_ce/pull/67)


## 0.2.7 - 2021-10-14
### Changed
- Changed [EthTx](https://github.com/EthTx/ethtx) version - >=0.3.0,<0.4.0 [#62](https://github.com/EthTx/ethtx_ce/pull/62)
- Changed [EthTx](https://github.com/EthTx/ethtx) version - >=0.3.0,<
0.4.0 [#62](https://github.com/EthTx/ethtx_ce/pull/62)
- Deleted usage of mongodb variable [#61](https://github.com/EthTx/ethtx_ce/pull/61)

### Fixed
Expand All @@ -21,7 +31,7 @@ All notable changes to this project will be documented in this file.


## 0.2.4 - 2021-09-29
### Added
### Added
- Added `.env_sample` file with example environment variables [#57](https://github.com/EthTx/ethtx_ce/pull/57)

### Fixed
Expand All @@ -33,7 +43,7 @@ All notable changes to this project will be documented in this file.


## 0.2.3 - 2021-09-23
### Added
### Added
- Color guessed functions and events [#56](https://github.com/EthTx/ethtx_ce/pull/56)


Expand Down Expand Up @@ -61,7 +71,7 @@ All notable changes to this project will be documented in this file.
- Updated links.

### Fixed - [#44](https://github.com/EthTx/ethtx_ce/pull/44)
- Fixed frontend styles.
- Fixed frontend styles.


## 0.1.10 - 2021-08-20
Expand All @@ -78,7 +88,7 @@ All notable changes to this project will be documented in this file.
- Changed [EthTx](https://github.com/EthTx/ethtx) version - >=0.2.0,<0.3.0.

### Fixed
- Etherscan links fixed for testnets.
- Etherscan links fixed for testnets.


## 0.1.8 - 2021-08-11
Expand All @@ -88,7 +98,6 @@ All notable changes to this project will be documented in this file.
### Changed
- Changed [EthTx](https://github.com/EthTx/ethtx) version - >=0.2.0,<0.3.0.


## 0.1.7 - 2021-08-05
### Added
- Added link to PyPi.
Expand All @@ -102,12 +111,12 @@ All notable changes to this project will be documented in this file.
- Removed `Pipfile.lock`

### Fixed
- Fixed application dependencies.
- Fixed application dependencies.


## 0.1.5 - 2021-08-02
### Changed
- Removed the banner that was about the new version of `ethtx_ce`.
- Removed the banner that was about the new version of `ethtx_ce`.


## 0.1.4 - 2021-07-29
Expand Down Expand Up @@ -138,7 +147,6 @@ All notable changes to this project will be documented in this file.
### Added
- Added configuration: AWS, Pipfile, pre-commit.


## v0.1.0 - 2021-07-23
## 0.1.0 - 2021-07-23
### Added
- First version EthTx CE.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ Here is a list of steps to recreate local environment on <b>Ubuntu</b> distribut
```shell
apt install docker-compose python3-pip pipenv make
```
2. Run `pipenv install`. This will create new venv with all required packages installed, including `ethtx` library
2. Run `pipenv install`. This will create new `venv` with all required packages installed, including `ethtx` library
3. Copy `.env_sample` to `.env` and fill required field according to description
```
# Proper nodes are required to run ethtx, provide connection strings for chains which will be used.
MAINNET_NODE_URL=https://geth-erigon-node:8545
# KOVAN_NODE_URL=
# RINKEBY_NODE_URL=

# EthTx supports multiple nodes, if one is unavailable, it will use others. You only need to specify them with a comma
# Example: MAINNET_NODE_URL=https://geth-erigon-node:8545,https://geth1-erigon-node:8545


# Etherscan API is used to get contract source code, required for decoding process
# You can get free key here https://etherscan.io/apis
ETHERSCAN_KEY=
Expand Down
6 changes: 3 additions & 3 deletions ethtx_ce/api/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def handle_all_http_exceptions(error: HTTPException) -> BaseErrorType:
return BaseRequestException(error.code, error.description, request.path), error.code


@exceptions_bp.app_errorhandler(ethtx_exceptions.Web3ConnectionException)
def web3_connection_error(error) -> BaseErrorType:
"""EthTx - Web3 connection problem."""
@exceptions_bp.app_errorhandler(ethtx_exceptions.NodeConnectionException)
def node_connection_error(error) -> BaseErrorType:
"""EthTx - Node connection error."""
return BaseRequestException(500, error, request.path), 500


Expand Down
6 changes: 3 additions & 3 deletions ethtx_ce/frontend/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def handle_all_http_exceptions(error: HTTPException) -> HTTPException:
return error


@exceptions_bp.app_errorhandler(ethtx_exceptions.Web3ConnectionException)
@exceptions_bp.app_errorhandler(ethtx_exceptions.NodeConnectionException)
@render_error_page(500)
def web3_connection_error(error) -> str:
"""EthTx - Web3 connection problem."""
def node_connection_error(error) -> str:
"""EthTx - Node connection error."""
return error


Expand Down
61 changes: 2 additions & 59 deletions ethtx_ce/frontend/templates/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,63 +103,6 @@
{% endif %}
{% endmacro %}


{%- macro print_call_line(call) -%}
<li id="{{ call.id }}"
class="indent-{{ call.indent }} {% if call.indent < 6 %}expanded{% endif %}">
<p>
<span style="color: slategray">[{{- call.gas_used if call.gas_used != None else "N/A" -}}]: </span>
{% if call.error %}
<span style='color: red'>({{ call.error }})</span>
{% endif %}
{% if call.call_type == "delegatecall" %}
<span style='color: darkorange'>(delegate)</span>
{% endif %}
{% if call.value and call.call_type != "selfdestruct" %}
<span style='color: blue'>ETH {{ call.value -}}</span>
{% endif %}
{%- if call.call_type == "selfdestruct" -%}
{{- address_link(call.from_address.address, call.from_address.name, call.from_address.badge) -}}
<span style='color: darkgreen'>.{{ call.call_type }}({% if call.value > 0 %}
<span style='color: blue'>ETH {{ call.value }}</span> =>
{{ address_link(call.to_address.address, call.to_address.name, call.to_address.badge) -}}{% endif %}
)</span>
{%- elif call.call_type == "create" -%}
{{- address_link(call.to_address.address, call.to_address.name, call.to_address.badge) -}}.
<span style='color: darkgreen'>New()</span>
{%- else -%}

{%- if call.call_type == "delegatecall" -%}
{{- address_link(call.from_address.address, call.from_address.name, call.from_address.badge) -}}
{%- else -%}
{{- address_link(call.to_address.address, call.to_address.name, call.to_address.badge) -}}
{%- endif -%}

{%- if call.call_type == "delegatecall" -%}
[
<span class='delegate'>{{- address_link(call.to_address.address, call.to_address.name, call.to_address.badge) -}}</span>
{%- endif -%}
{%- if call.function_name != "0x" -%}
<span style='color: darkgreen'>.{{- call.function_name -}}</span>
{%- else -%}
<span style='color: darkgreen'>.fallback</span>
{%- endif -%}
{%- if call.call_type == "delegatecall" -%}
]
{%- endif -%}

<span>({{- print_call_arguments(call.arguments) -}}) => ({{- print_call_arguments(call.outputs) -}})</span>
{%- endif -%}
</p>
<ul>
{% for sub_call in call.subcalls %}
{{- print_call_line(sub_call) -}}
{% endfor %}
</ul>
</li>
{%- endmacro -%}


{%- macro print_call_line(call) -%}
<li id="{{ call.id }}"
class="indent-{{ call.indent }} {% if call.indent < 6 %}expanded{% endif %}">
Expand Down Expand Up @@ -195,7 +138,7 @@
[<span
class='delegate'>{{- address_link(call.to_address.address, call.to_address.name, call.to_address.badge) -}}</span>
{%- endif -%}
{%- if call.function_name != "0x" and call.arguments and ("arg" in call.arguments[0]["name"] or (call.arguments[0]["name"] == "params" and "arg" in call.arguments[0]["value"][0]["name"])) -%}
{%- if call.function_guessed -%}
<span style='color: dodgerblue'>.{{- call.function_name -}}</span>
{%- elif call.function_name != "0x" -%}
<span style='color: darkgreen'>.{{- call.function_name -}}</span>
Expand Down Expand Up @@ -313,7 +256,7 @@ <h3>Emitted events:</h3>
<td>
<span style="color: slategray">[{{- event.index -}}]</span>
{{ address_link(event.contract.address, event.contract.name, event.contract.badge) }}
{%- if not event.event_name.startswith("0x") and event.parameters and not event.parameters[0]["name"] and event.parameters[0]["type"] != "tuple" -%}
{%- if event.event_guessed -%}
<span style='color: dodgerblue'>.{{ event.event_name }}</span>
{%- else -%}
<span style='color: darkgreen'>.{{ event.event_name }}</span>
Expand Down

0 comments on commit 5dd8e40

Please sign in to comment.