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

refactor: allow gas estimation when unconnected #2231

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

fionnachan
Copy link
Member

@fionnachan fionnachan commented Feb 4, 2025

Part of #1452
also added test for useGasSummary

@cla-bot cla-bot bot added the cla-signed label Feb 4, 2025
Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Feb 12, 2025 11:56am

) {
return {
status: 'unavailable',
estimatedParentChainGasFees: undefined,
Copy link
Member Author

Choose a reason for hiding this comment

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

This no longer specifies undefined for this case, just returning estimatedParentChainGasFees as it was.

I checked the UI for native USDC withdrawal from Arb Sepolia to Sepolia and it looks fine

@fionnachan fionnachan marked this pull request as ready for review February 10, 2025 13:40
}

if (
(gasEstimatesError && gasEstimatesError !== 'walletNotConnected') ||
Copy link
Member Author

Choose a reason for hiding this comment

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

new condition to bypass 'walletNotConnected'

Copy link
Member Author

@fionnachan fionnachan Feb 10, 2025

Choose a reason for hiding this comment

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

encountered this error with import statement of react in import { useDebounce } from '@uidotdev/usehooks'
so we need to configure this and install ts-jest and babel-jest

https://stackoverflow.com/questions/58613492/how-to-resolve-cannot-use-import-statement-outside-a-module-from-jest-when-run

'gasEstimates'
] as const)
: null,
[
Copy link
Contributor

Choose a reason for hiding this comment

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

We will need to make a similar change in useOftV2FeeEstmates hook

@@ -113,5 +109,9 @@ export function useGasEstimates({
}
)

if (typeof walletAddress === 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would we need this error now that we're handling undefined walletAddress?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if really needed, can this be moved inside the fetcher?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants