Skip to content

Commit

Permalink
Merge pull request #714 from eth-brownie/feat-ganache-6.10.1
Browse files Browse the repository at this point in the history
Ganache 6.10.1
  • Loading branch information
iamdefinitelyahuman authored Aug 7, 2020
2 parents 8c5d5c9 + 350cecb commit a5ea929
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install -g ganache-cli@6.8.2
run: npm install -g ganache-cli@6.10.1

- name: Setup Python 3.8
uses: actions/setup-python@v1
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install -g ganache-cli@6.8.2
run: npm install -g ganache-cli@6.10.1

- name: Setup Python 3.8
uses: actions/setup-python@v1
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install -g ganache-cli@6.8.2
run: npm install -g ganache-cli@6.10.1

- name: Setup Python 3.8
uses: actions/setup-python@v1
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install -g ganache-cli@6.8.2
run: npm install -g ganache-cli@6.10.1

- name: Setup Python 3.7
uses: actions/setup-python@v1
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install -g ganache-cli@6.8.2
run: npm install -g ganache-cli@6.10.1

- name: Setup Python 3.6
uses: actions/setup-python@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Brownie is a Python-based development and testing framework for smart contracts
## Dependencies

* [python3](https://www.python.org/downloads/release/python-368/) version 3.6 or greater, python3-dev
* [ganache-cli](https://github.com/trufflesuite/ganache-cli) - tested with version [6.8.2](https://github.com/trufflesuite/ganache-cli/releases/tag/v6.8.2)
* [ganache-cli](https://github.com/trufflesuite/ganache-cli) - tested with version [6.10.1](https://github.com/trufflesuite/ganache-cli/releases/tag/v6.10.1)

## Installation

Expand Down
13 changes: 9 additions & 4 deletions brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,15 @@ def _expand_trace(self) -> None:
t["depth"] = t["depth"] - 1
else:
self._trace_origin = "ganache"
self._call_cost = trace[0]["gasCost"]
for i in range(len(trace) - 1):
trace[i]["gasCost"] = trace[i + 1]["gasCost"]
trace[-1]["gasCost"] = 0
if trace[0]["gasCost"] >= 21000:
# in ganache <6.10.0, gas costs are shifted by one step - we can
# identify this when the first step has a gas cost >= 21000
self._call_cost = trace[0]["gasCost"]
for i in range(len(trace) - 1):
trace[i]["gasCost"] = trace[i + 1]["gasCost"]
trace[-1]["gasCost"] = 0
else:
self._call_cost = self.gas_used - trace[0]["gas"] + trace[-1]["gas"]

# last_map gives a quick reference of previous values at each depth
last_map = {0: _get_last_map(self.receiver, self.input[:10])} # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Dependencies
Brownie has the following dependencies:

* `python3 <https://www.python.org/downloads/release/python-368/>`_ version 3.6 or greater, python3-dev
* `ganache-cli <https://github.com/trufflesuite/ganache-cli>`_ - tested with version `6.8.2 <https://github.com/trufflesuite/ganache-cli/releases/tag/v6.8.2>`_
* `ganache-cli <https://github.com/trufflesuite/ganache-cli>`_ - tested with version `6.10.1 <https://github.com/trufflesuite/ganache-cli/releases/tag/v6.10.1>`_

.. _install-tk:

Expand Down

0 comments on commit a5ea929

Please sign in to comment.