Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix: preserve from field in SignerMiddleware #350

Merged
merged 1 commit into from
Jul 27, 2021
Merged

Conversation

wolflo
Copy link
Contributor

@wolflo wolflo commented Jul 26, 2021

Fixes #349

Solution

  • send_transaction() attempts to preserve the from field of a TransactionRequest by forwarding to inner.send_transaction() in the case when a from address other than the signer address is specified
  • sign_transaction() returns a WrongSigner error if asked to sign a TransactionRequest with a from address other than the signer specified.

It might make sense for sign_transaction() to sign and replace the from field anyway, since it is explicitly being asked to sign from that address.

@gakonst gakonst merged commit e7f603f into gakonst:master Jul 27, 2021
@gakonst
Copy link
Owner

gakonst commented Jul 27, 2021

Looks good! Thank you!

meetmangukiya pushed a commit to meetmangukiya/ethers-rs that referenced this pull request Mar 21, 2022
gakonst#350)

Otherwise we may start over from dirty state from a previous unit or fuzz test
and that can break test isolation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SignerMiddleware::send_transaction() drops the from field
2 participants