You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating from 1.0.0-beta.35 to 1.0.0-beta.50 I have got a problem with this code snippet in my program:
let decryptedAccount = web3.eth.accounts.decrypt(V3keystoreStr, password);
let baseNonce = await web3.eth.getTransactionCount(decryptedAccount.address);
let paramObj = {from: decryptedAccount.address, gas: TX_GAS_LIMIT, gasPrice: 0 };
let contract = new web3.eth.Contract(contractAbi, contractAddress, paramObj);
let txData = contract.myMethod(...myMethodParams).encodeABI();
let tx = {
from: decryptedAccount.address,
to: contractAddress,
data: txData,
gas: TX_GAS_LIMIT,
gasPrice: 0, // JP Quorum
chainId: CHAIN_ID,
nonce: baseNonce
}
let signedTx = await decryptedAccount.signTransaction(tx);
Expected behavior
Raw transaction (tx) should be signed, and returned in signedTx.
Actual behavior
I've got the error:
TypeError: this.accounts.signTransaction is not a function at Proxy.signTransaction (/var/work/test-1by1-4/dsd/tests/node_modules/web3-eth-accounts/dist/web3-eth-accounts.cjs.js:65:28)
I think the problem in web3.js/packages/web3-eth-accounts/src/models/Account.js module. So in my code:
let decryptedAccount = web3.eth.accounts.decrypt(V3keystoreStr, password);
The web3.accounts.decrypt(...) function is called. And it calls Account.fromPrivateKey(...):
// Account.js: line 128:
static fromPrivateKey(privateKey, accounts = {}) {
return new Account(fromPrivate(privateKey), accounts.transactionSigner);
// Account.accounts = transactionSigner
}
When I call:
let signedTx = await decryptedAccount.signTransaction(tx);
It calls:
// Account.js: line 60:
signTransaction(tx, callback) {
return this.accounts.signTransaction(tx, this.privateKey, callback);
// no signTransaction(...) in transactionSigner object
}
And it is no signTransaction(...) function in transactionSigner object.
Versions
web3js: 1.0.0-beta.50
nodejs: v8.11.3
ethereum node: JP Quorum
The text was updated successfully, but these errors were encountered:
Description
After updating from
1.0.0-beta.35
to1.0.0-beta.50
I have got a problem with this code snippet in my program:Expected behavior
Raw transaction (
tx
) should be signed, and returned insignedTx
.Actual behavior
I've got the error:
I think the problem in
web3.js/packages/web3-eth-accounts/src/models/Account.js
module. So in my code:The
web3.accounts.decrypt(...)
function is called. And it callsAccount.fromPrivateKey(...)
:When I call:
It calls:
And it is no signTransaction(...) function in transactionSigner object.
Versions
The text was updated successfully, but these errors were encountered: