Skip to content

Commit

Permalink
updating checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Jun 11, 2021
1 parent 39ff2c0 commit 5fec5ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/web3-eth-accounts/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ Accounts.prototype.recoverTransaction = function recoverTransaction(rawTx, txOpt
// Rely on EthereumJs/tx to determine the type of transaction
const data = Buffer.from(rawTx.slice(2), "hex")
const tx = TransactionFactory.fromSerializedData(data);
return tx.getSenderAddress().toString("hex");
//update checksum
return utils.toChecksumAddress(tx.getSenderAddress().toString("hex"));
};
/* jshint ignore:end */

Expand Down
2 changes: 1 addition & 1 deletion test/eth.accounts.signTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ describe("eth", function () {
var testAccount = ethAccounts.privateKeyToAccount(test.privateKey);
assert.equal(testAccount.address, test.address);
testAccount.signTransaction(test.transaction).then(function (tx) {
assert.equal(ethAccounts.recoverTransaction(tx.rawTransaction), test.address.toLowerCase());
assert.equal(ethAccounts.recoverTransaction(tx.rawTransaction), test.address);
done();
})
.catch(e => {
Expand Down

0 comments on commit 5fec5ff

Please sign in to comment.