Skip to content
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

fix(tx): when txReceipt.effectiveGasPrice is nill can't call txReceipt.effectiveGasPrice.toString() #1571

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

luchenqun
Copy link
Contributor

@luchenqun luchenqun commented Feb 5, 2024

Description and Related Issue(s)

when txReceipt.effectiveGasPrice is nill can't call txReceipt.effectiveGasPrice.toString() , see

const gasPrice = txReceipt?.effectiveGasPrice ?? tx.gasPrice;
return {
from: { ...unknownAddress, hash: tx.from as string },
to: tx.to ? { ...unknownAddress, hash: tx.to as string } : null,
hash: tx.hash as string,
timestamp: block?.timestamp ? dayjs.unix(Number(block.timestamp)).format() : null,
confirmation_duration: null,
status,
block: tx.blockNumber ? Number(tx.blockNumber) : null,
value: tx.value.toString(),
gas_price: txReceipt?.effectiveGasPrice.toString() ?? tx.gasPrice?.toString() ?? null,

@tom2drum tom2drum merged commit c2d398e into blockscout:main Feb 6, 2024
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