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

Call to account.signTransaction({...}) throw TypeError #2356

Closed
ericbinet opened this issue Feb 8, 2019 · 6 comments · Fixed by #2367
Closed

Call to account.signTransaction({...}) throw TypeError #2356

ericbinet opened this issue Feb 8, 2019 · 6 comments · Fixed by #2367
Labels
Bug Addressing a bug

Comments

@ericbinet
Copy link

Expected behavior

When supplying a fully defined transaction to account.signTransaction, a signed transaction should be returned.

Actual behavior

As it stands, the method throws a TypeError: this.signTransaction(...).bind is not a function. This is caused by the early return on line 230 of Accounts.js.

Steps to reproduce the behavior

const Web3 = require("web3");

const web3 = new Web3(Web3.givenProvider || "ws://localhost:8546");
let pk = "0x0e652850717658cfd360d2c97474f4b2d8db5a9222adef2ebce67788f75e58f8";
let account = web3.eth.accounts.privateKeyToAccount(pk);
let signedTx = account.signTransaction({
    nonce: "0",
    chainId: "1",
    to: account.address,
    data: web3.utils.toHex('msg'),
    value: "0",
    gasPrice: "0",
    gas: "0"}
    );

Error Logs

TypeError: this.signTransaction(...).bind is not a function

Versions

  • NPM: 6.4.1
  • Node: 10.15.0
  • Web3.js: 1.0.0-beta.44
  • OS: Windows 10
@nivida
Copy link
Contributor

nivida commented Feb 9, 2019

Thanks for submitting this issue. Because I had several problems with the accounts module do I refactor it to finally solve these issues.

@nivida nivida added the Bug Addressing a bug label Feb 9, 2019
junwei0117 added a commit to junwei0117/claimHub that referenced this issue Feb 18, 2019
- Have a transaction signing problem, is a web3.js bug, detail can be
found at below web3/web3.js#2356
@stefdelec
Copy link

Was it closed because there is a solution?

@ericbinet
Copy link
Author

Does it still occur in beta50? If so, post repro steps and reopen.

@stefdelec
Copy link

Ok. I still have this issue (a bit different)

TypeError: this.accounts.signTransaction is not a function

@ericbinet
Copy link
Author

Since the symptoms are not the same, it's best to create a new issue with the proper description and repro steps.

@stefdelec
Copy link

ok.

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

Successfully merging a pull request may close this issue.

3 participants