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

Metamask stops working if gas is passed as an object #6707

Closed
rstormsf opened this issue Jun 11, 2019 · 2 comments · Fixed by #6713
Closed

Metamask stops working if gas is passed as an object #6707

rstormsf opened this issue Jun 11, 2019 · 2 comments · Fixed by #6713
Labels

Comments

@rstormsf
Copy link

rstormsf commented Jun 11, 2019

To Reproduce
Steps to reproduce the behavior:

  1. Open https://codepen.io/rstormsf/pen/qzBRBe?editors=1010
  2. Click Click me button
window.ethereum.sendAsync({
                    method: 'eth_sendTransaction',
                    params: [{
                        from: acc,
                        to: "0x0039f22efb07a647557c7c5d17854cfd6d489ef3",
                        gas: {}, // provide Gas as an Object
                        gasPrice: "0x77359400",
                        value: "0x0",
                        data: "0x0"
                    }],
                    jsonrpc: '2.0'
                }, (err, response) => {
                    window.alert(JSON.stringify(err))
                    console.log(response)
                })

Expected behavior
It should not break metamask

Screenshots
image

Browser details (please complete the following information):

  • OS: OSX
  • Browser chrome
  • MetaMask Version 6.6.1

Additional context
metamask_big

@rstormsf
Copy link
Author

rstormsf commented Jun 11, 2019

I can't even reset the account in metamask, I can't use that account anymore. It's showstopper issue

@bdresser bdresser added good first issue Good for newcomers type-bug labels Jun 11, 2019
@akshitkrnagpal
Copy link
Contributor

akshitkrnagpal commented Jun 14, 2019

Hi
I am new to MetaMask project and would like to work on this.
I already have a local build of MetaMask extension and I am able to reproduce the bug.

After some investigation, I found that this problem is arising because the transaction is being added in the unapprovedTxs without validation of txParams. Validation of txParams in only done in TransactionStateManager.updateTx() and not in TransactionStateManager.addTx().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants