Skip to content

Commit

Permalink
Use eth_chainId when signing transactions (web3#3097)
Browse files Browse the repository at this point in the history
* Use eth_chainId when signing transactions
  • Loading branch information
cgewecke authored and nachomazzara committed Jun 4, 2020
1 parent a25f75c commit 23063ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ Released with 1.0.0-beta.37 code base.

### Fixed

- Fix incorrectly populating chainId param with `net_version` when signing txs (#2378)
- regeneratorRuntime error fixed (#3058)
- Fix accessing event.name where event is undefined (#3014)
2 changes: 1 addition & 1 deletion packages/web3-eth-accounts/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var Accounts = function Accounts() {
var _ethereumCall = [
new Method({
name: 'getId',
call: 'net_version',
call: 'eth_chainId',
params: 0,
outputFormatter: utils.hexToNumber
}),
Expand Down
4 changes: 2 additions & 2 deletions test/eth.accounts.signTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ describe("eth", function () {
provider.injectResult(1);
provider.injectValidation(function (payload) {
assert.equal(payload.jsonrpc, '2.0');
assert.equal(payload.method, 'net_version');
assert.equal(payload.method, 'eth_chainId');
assert.deepEqual(payload.params, []);
});

Expand All @@ -522,7 +522,7 @@ describe("eth", function () {
provider.injectResult(1);
provider.injectValidation(function (payload) {
assert.equal(payload.jsonrpc, '2.0');
assert.equal(payload.method, 'net_version');
assert.equal(payload.method, 'eth_chainId');
assert.deepEqual(payload.params, []);
});
provider.injectResult(1);
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/test.method.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ var useLocalWallet = function (test, provider, web3) {

test.useLocalWallet(web3);

provider.injectResult(1);
provider.injectResult("0x1");
provider.injectValidation(function (payload) {
assert.equal(payload.jsonrpc, '2.0');
assert.equal(payload.method, 'net_version');
assert.equal(payload.method, 'eth_chainId');
assert.deepEqual(payload.params, []);
});

Expand Down

0 comments on commit 23063ab

Please sign in to comment.