-
Notifications
You must be signed in to change notification settings - Fork 682
eth_signTransaction not supported #408
Comments
Thanks @wolever for filing this issue. We haven't intentionally removed any features in ganache-cli@6.2.x, so this would be a regression if we did! Whats the most recent version of ganache-cli that doesn't cause test failures for you? |
So I think we misread that this maybe was a regression, but looking over again, it looks like what we thought: we don't support this yet, and never have. Added to the list! Thanks! |
|
|
hoops :) |
With that said, it looks like geth and parity already support it, as well as web3 and MetaMask. As long as geth and parity agree on the implementation I don't see any harm in adding it to gananche. |
I solved this by creating new accounts using `web3.eth.accounts.wallet.create(x)' (where x = number of accounts I want to generate). I then associated the newly created accounts to some global variables accessible through my tests. See below: contract("My Contract", async (accounts) => {
let firstAccount,
secondAccount,
thirdAccount
before(async () => {
await web3.eth.accounts.wallet.create(3) // create 3 accounts
firstAccount = web3.eth.accounts.wallet[0]
secondAccount = web3.eth.accounts.wallet[1]
thirdAccount = web3.eth.accounts.wallet[2]
})
// tests here...
}) I was then able to sign data within my tests, using either the:
I could then sign in two ways // method 1
web3.eth.accounts.wallet[firstAccount].sign("Message To Sign")
// method 2
web3.eth.accounts.sign("Message To Sign", firstAccount.privateKey) See response on Ethereum StackExchange question: Sign data with private key inside a truffle test file |
This has been implemented in Ganache v7. See our Upgrade Guide if you want to use this feature! |
As of Ganache 6.2.1, using
web3.eth.signTransaction(...)
returnsMethod eth_signTransaction not supported
.We run our test suite against ganache, and some tests can't run because of this.
The text was updated successfully, but these errors were encountered: