Skip to content

Commit

Permalink
fix: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryTong65 committed Oct 16, 2024
1 parent ca4c90e commit 54a7267
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/paymasterclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class PaymasterClient extends ethers.JsonRpcProvider {
if (policyUUID) {
const newConnection = this._getConnection()
newConnection.setHeader("X-MegaFuel-Policy-Uuid", policyUUID)
const sponsorProviderWithHeader = new ethers.JsonRpcProvider(
const provider = new ethers.JsonRpcProvider(
newConnection,
(this as any)._network,
{
Expand All @@ -102,7 +102,7 @@ export class PaymasterClient extends ethers.JsonRpcProvider {
polling: (this as any).polling
}
)
return await sponsorProviderWithHeader.send('pm_isSponsorable', [tx])
return await provider.send('pm_isSponsorable', [tx])
}
return await this.send('pm_isSponsorable', [tx])
}
Expand All @@ -119,7 +119,7 @@ export class PaymasterClient extends ethers.JsonRpcProvider {
newConnection.setHeader("X-MegaFuel-Policy-Uuid", policyUUID)
}

const sponsorProvider = new ethers.JsonRpcProvider(
const provider = new ethers.JsonRpcProvider(
newConnection,
(this as any)._network,
{
Expand All @@ -128,10 +128,8 @@ export class PaymasterClient extends ethers.JsonRpcProvider {
polling: (this as any).polling
}
)

if (policyUUID) {
return await sponsorProvider.send('eth_sendRawTransaction', [signedTx])
}

return await provider.send('eth_sendRawTransaction', [signedTx])
}
return await this.send('eth_sendRawTransaction', [signedTx])
}
Expand Down

0 comments on commit 54a7267

Please sign in to comment.