Skip to content

fix: Treat effectiveGasPrice from the receipt as optional #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Jun 21, 2024

Treat effectiveGasPrice as optional from a transaction receipt response.


PR-Codex overview

This PR updates the handling of effectiveGasPrice in different parts of the codebase to handle potential null values.

Detailed summary

  • Updated effectiveGasPrice handling in getTxReceipt.ts, processTransactionReceiptsWorker.ts, and updateMinedTx.ts
  • Added optional chaining and nullish coalescing operators to prevent errors from potential null values

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@@ -185,7 +185,7 @@ const getFormattedTransactionReceipts = async ({
functionName,
transactionIndex: receipt.transactionIndex,
gasUsed: receipt.gasUsed.toString(),
effectiveGasPrice: receipt.effectiveGasPrice.toString(),
effectiveGasPrice: receipt.effectiveGasPrice?.toString() ?? "",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A string is expected to be stored here so we store an empty string.

@arcoraven arcoraven merged commit f5a269a into main Jun 21, 2024
4 checks passed
@arcoraven arcoraven deleted the ph/effectiveGasPriceOptional branch June 21, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants