Skip to content

Commit

Permalink
fix(signer): make Signer compatible when created using `Web3Provide…
Browse files Browse the repository at this point in the history
…r.getSigner()`
  • Loading branch information
danijelTxFusion committed Apr 23, 2024
1 parent 4527ac6 commit 3c04804
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zksync-ethers",
"version": "5.8.0-beta.4",
"version": "5.8.0-beta.5",
"description": "A Web3 library for interacting with the ZkSync Layer 2 scaling solution.",
"author": {
"name": "Matter Labs",
Expand Down
7 changes: 4 additions & 3 deletions src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ export class Signer extends AdapterL2(ethers.providers.JsonRpcSigner) {
}

override _providerL2() {
return this.providerL2!;
// Make it compatible when singer is created with Web3Provider.getSigner()
return this.providerL2 ? this.providerL2 : this.provider;
}

/**
Expand Down Expand Up @@ -345,7 +346,7 @@ export class Signer extends AdapterL2(ethers.providers.JsonRpcSigner) {
* Provider.getDefaultProvider(types.Network.Sepolia)
* );
*
* const tx = signer.transfer({
* const tx = await signer.transfer({
* to: Wallet.createRandom().address,
* amount: ethers.utils.parseEther("0.01"),
* });
Expand All @@ -364,7 +365,7 @@ export class Signer extends AdapterL2(ethers.providers.JsonRpcSigner) {
* Provider.getDefaultProvider(types.Network.Sepolia)
* );
*
* const tx = signer.transfer({
* const tx = await signer.transfer({
* to: Wallet.createRandom().address,
* amount: ethers.utils.parseEther("0.01"),
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand Down

0 comments on commit 3c04804

Please sign in to comment.