Skip to content

Commit

Permalink
refactor(signer): override sendTransaction in L2VoidSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
petarTxFusion committed Aug 27, 2024
1 parent 1020705 commit 7e6d6b7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ export class L2VoidSigner extends AdapterL2(ethers.VoidSigner) {
return (await super.populateTransaction(tx)) as TransactionLike;
}

tx.type = EIP712_TX_TYPE;
tx.type = 2;
const populated = (await super.populateTransaction(tx)) as TransactionLike;

populated.type = EIP712_TX_TYPE;
Expand All @@ -1724,6 +1724,16 @@ export class L2VoidSigner extends AdapterL2(ethers.VoidSigner) {
}
return populated;
}

override async sendTransaction(
tx: TransactionRequest
): Promise<TransactionResponse> {
const populated = await this.populateTransaction(tx);

return this.provider.broadcastTransaction(
await this.signTransaction(populated)
);
}
}

/**
Expand Down

0 comments on commit 7e6d6b7

Please sign in to comment.