Skip to content

Commit

Permalink
fix: remove customData when sending the tx via ethers
Browse files Browse the repository at this point in the history
  • Loading branch information
aramalipoor committed Dec 8, 2022
1 parent cbf90c2 commit 3031dc5
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export class BalanceRampClient {
});

if (!requiredBalance?.outputTokenAddress) {
return originalSigner.sendTransaction(txWithGasData);
return this.sendTransactionOriginal(originalSigner, txWithGasData);
}

if (
requiredBalance.outputTokenAddress !== constants.AddressZero &&
!ethers.utils.isAddress(requiredBalance.outputTokenAddress)
) {
return originalSigner.sendTransaction(txWithGasData);
return this.sendTransactionOriginal(originalSigner, txWithGasData);
}

const currentBalance = await this.getCurrentBalance(
Expand Down Expand Up @@ -153,10 +153,22 @@ export class BalanceRampClient {
);
}

return originalSigner.sendTransaction(txWithGasData);
return this.sendTransactionOriginal(originalSigner, txWithGasData);
}

return originalSigner.sendTransaction(txWithGasData);
return this.sendTransactionOriginal(originalSigner, txWithGasData);
}

async sendTransactionOriginal(
originalSigner: ethers.Signer,
txWithGasData: ethers.utils.Deferrable<TransactionRequest>,
): Promise<TransactionResponse> {
const cleanTx = {
...txWithGasData,
customData: undefined,
};

return originalSigner.sendTransaction(cleanTx);
}

async handleEstimateGasLimit(
Expand Down

0 comments on commit 3031dc5

Please sign in to comment.