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

JsonRpcSigner.prototype.sendTransaction fails with "invalid key - from" #306

Closed
mschristensen opened this issue Oct 14, 2018 · 5 comments
Closed
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@mschristensen
Copy link

The sendTransaction method on an JsonRpcSigner instance (from the getSigner method) appears to be broken:

Error: invalid key - from (argument="transaction", value=...

The from key should not be required, and seems to be set up incorrectly by the signer.

Can anyone else reproduce, or alternatively provide a working example?

Example usage:

await web3Provider.getSigner().sendTransaction({
        to: ethAddress,
        value: ethers.utils.parseEther(this.amountToEther()),
});
@ricmoo
Copy link
Member

ricmoo commented Oct 14, 2018

I’ll look into this today. Probably related to a fix put in yesterday; the from is added internally for calling estimateGas.

Can you try explicitly adding a gasLimit to the transaction?

@ricmoo ricmoo added investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Oct 14, 2018
@ricmoo ricmoo self-assigned this Oct 14, 2018
@ricmoo ricmoo added bug Verified to be an issue. and removed investigate Under investigation and may be a bug. labels Oct 14, 2018
@ricmoo
Copy link
Member

ricmoo commented Oct 14, 2018

I found the problem. I will be doing a small re-factor too which will fix this and make it easier for Signer authors.

We also need a way to run regression tests against a node with accounts; this should have been caught in a test case. Sorry. :(

In the future we will be able to use ethers-vm for better testing.

@ricmoo ricmoo changed the title getSigner().sendTransaction(...) appears to be broken JsonRpcSigner.prototype.sendTransaction fails with "invalid key - from" Oct 14, 2018
@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label Oct 14, 2018
@ricmoo
Copy link
Member

ricmoo commented Oct 14, 2018

A fix for this (along with tests in tests/local-tests.js) has been deployed in version 4.0.7. Please try it out and let me know if you have any issues. I'll leave the issue open a bit longer to verify the fix worked.

@ricmoo
Copy link
Member

ricmoo commented Oct 15, 2018

I'm going to close this now, but if you are still experiencing issues, please feel free to re-open.

Thanks! :)

@ricmoo ricmoo closed this as completed Oct 15, 2018
@mschristensen
Copy link
Author

Can confirm this is fixed. Thanks for doing this promptly!

@ricmoo ricmoo added the fixed/complete This Bug is fixed or Enhancement is complete and published. label Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants