-
Notifications
You must be signed in to change notification settings - Fork 686
E2e send L2 transaction #6788
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
base: develop
Are you sure you want to change the base?
E2e send L2 transaction #6788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm, left a few nits and questions for you about the setup. Sorry for so many comments!
e2e/utils/FundPolygonWallet.yaml
Outdated
--- | ||
# Fund the test wallet with Polygon tokens | ||
- tapOn: | ||
id: fund-polygon-wallet-button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jw why this is a separate file instead of just inline in the test itself? I don't mind if it's necessary but seems funny.
src/helpers/RainbowContext.tsx
Outdated
} | ||
|
||
// Fund the test wallet with ETH directly (this will be detected as the native asset) | ||
// The issue is that Polygon on Anvil should use ETH as the gas token, not POL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this comment isn't accurate actually in a live environment, Polygon should be using POL as the gas token. is this a quirk of Anvil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrodyHughes I updated the comment to make it more easy to read.
logger.error(new RainbowError(`[anvilAssets]: Error fetching balances from Anvil node: ${e}`)); | ||
return null; | ||
|
||
// Fallback: return configured quantities for testnet when balance checks fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nice! i noticed when testing that the balances populated immediately and I'm guessing this is the cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes my tought was to make it faster/simpler for testing purpose.
src/state/assets/utils.ts
Outdated
|
||
if (testnetMode) { | ||
const { assets, chainIdsInResponse } = await fetchAnvilBalancesByChainId(address, ChainId.mainnet); | ||
const { assets, chainIdsInResponse } = await fetchAnvilBalancesByChainId(address, ChainId.anvil); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to concat the two here instead of changing to anvil? I know our anvil instance is spun up using a chainId of 1
(which is mainnet). I wonder if were doing two things now:
- adding fallback balances that are on
ChainId.anvil
- sending dev funds on a mainnet fork with anvil using
ChainId.mainnet
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrodyHughes I did make an update where I concat them. Thank you !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This add E2E testing for L2 Transaction