Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: "to" field is null during contract creation #1573

Merged
merged 2 commits into from
Jul 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/eth-brownie/brownie)

### Fixed
- Handle null value of `to` field in transaction receipt so that contract deploying with Anvil works properly ([#1573](https://github.com/eth-brownie/brownie/pull/1573))

## [1.19.0](https://github.com/eth-brownie/brownie/tree/v1.19.0) - 2022-05-29
### Added
- Initial support for [Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil), a blazing-fast local testnet node implementation in Rust ([#1541](https://github.com/eth-brownie/brownie/pull/1541))
Expand Down
4 changes: 2 additions & 2 deletions brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def _await_confirmation(self, block_number: int = None, required_confs: int = 1)
def _set_from_tx(self, tx: Dict) -> None:
if not self.sender:
self.sender = EthAddress(tx["from"])
self.receiver = EthAddress(tx["to"]) if tx["to"] else None
self.receiver = EthAddress(tx["to"]) if tx.get("to", None) else None
self.value = Wei(tx["value"])
self.gas_price = tx.get("gasPrice")
self.max_fee = tx.get("maxFeePerGas")
Expand All @@ -560,7 +560,7 @@ def _set_from_tx(self, tx: Dict) -> None:
if self.fn_name:
return
try:
contract = state._find_contract(tx["to"])
contract = state._find_contract(tx.get("to"))
if contract is not None:
self.contract_name = contract._name
self.fn_name = contract.get_method(tx["input"])
Expand Down