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

Replace transactions broadcast outside of brownie #922

Merged
merged 1 commit into from
Jan 6, 2021
Merged
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
13 changes: 12 additions & 1 deletion brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,18 @@ def replace(
if silent is None:
silent = self._silent

return self.sender.transfer( # type: ignore
sender = self.sender
if isinstance(sender, EthAddress):
# if the transaction wasn't broadcast during this brownie session,
# check if the sender is unlocked - we might be able to replace anyway
from brownie import accounts

if sender in accounts:
sender = accounts.at(sender)
else:
raise ValueError("Sender address not in `accounts`")

return sender.transfer( # type: ignore
self.receiver,
self.value,
gas_limit=self.gas_limit,
Expand Down