Skip to content

Commit

Permalink
Switching signatures to personal_sign for all web3 providers.
Browse files Browse the repository at this point in the history
Based on git issue ethers-io#1542 by alfetopito
  • Loading branch information
hc committed Aug 9, 2021
1 parent 4b163e9 commit a76330c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/providers/src.ts/web3-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function buildWeb3LegacyFetcher(provider: ExternalProvider, sendFunc: Web3Legacy
return function(method: string, params: Array<any>): Promise<any> {

// Metamask complains about eth_sign (and on some versions hangs)
if (method == "eth_sign" && (provider.isMetaMask || provider.isStatus)) {
if (method == "eth_sign") {
// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign
method = "personal_sign";
params = [ params[1], params[0] ];
Expand Down Expand Up @@ -93,7 +93,7 @@ function buildEip1193Fetcher(provider: ExternalProvider): JsonRpcFetchFunc {
if (params == null) { params = [ ]; }

// Metamask complains about eth_sign (and on some versions hangs)
if (method == "eth_sign" && (provider.isMetaMask || provider.isStatus)) {
if (method == "eth_sign") {
// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign
method = "personal_sign";
params = [ params[1], params[0] ];
Expand Down

0 comments on commit a76330c

Please sign in to comment.