-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add networkStore and runtime support for networks #1835
Changes from all commits
172e161
9d9176a
1e56210
db47ed3
3c9bf0e
3d344c0
e4dff77
3071a39
b79288b
398d38b
da9e61b
04b3b09
aa408df
3735682
421a8a4
e32d15d
01b3d3f
efd9ff9
c3e7ae2
61bb261
6dc7f26
361c850
343d490
43e98f9
b2b0146
1495742
c775a23
0c281a5
632a924
a0385d8
169ade9
ab58605
f4fe45c
3d14b23
3749ce0
5d6da8a
81cbf8e
02f7b64
58fd2d9
984aed1
735271f
8f51f0a
fa4fcbe
2d46255
6a2d1e5
dfd7129
5c83fa7
98222ac
8f314af
55a0953
c53c8e5
e806503
0ccb171
548ca50
96bad47
47d3e82
97c3d25
26ba053
4e5cbd8
3a4e107
683fa61
d54c015
c2328aa
06d4b36
916a768
0418b4c
324e4fe
0c1aa19
d5ea97f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ | |
"// Build and zip": "", | ||
"bundle": "yarn build && yarn zip", | ||
"// Runs tests": "", | ||
"anvil": "anvil --fork-url $(./scripts/get-rpc-url.sh mainnet) --fork-block-number 21574102 --block-base-fee-per-gas 5000000000 --block-gas-limit 30000000", | ||
"anvil": "anvil --fork-url $(./scripts/get-rpc-url.sh mainnet) --fork-block-number 21574102 --block-base-fee-per-gas 1000000000 --block-gas-limit 30000000", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this have a material effect on e2e? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it did. Bruno actually recommended it a few weeks ago if we saw more of a specific failure type which matthew was seeing. Again, i recommended this and it did fix an issue. |
||
"anvil:optimism": "anvil --fork-url $(./scripts/get-rpc-url.sh optimism)", | ||
"anvil:kill": "lsof -i :8545|tail -n +2|awk '{print $2}'|xargs -r kill -s SIGINT", | ||
"test": "./scripts/unit-tests.sh", | ||
|
@@ -166,7 +166,7 @@ | |
"viem": "2.21.55", | ||
"wagmi": "2.8.1", | ||
"word-wrap": "1.2.4", | ||
"zustand": "4.1.5" | ||
"zustand": "4.5.5" | ||
}, | ||
"devDependencies": { | ||
"@foundry-rs/hardhat-anvil": "0.1.7", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ import { | |
import { Address } from 'viem'; | ||
|
||
import { metadataPostClient } from '~/core/graphql'; | ||
import { getChainGasUnits } from '~/core/references/chains'; | ||
import { networkStore } from '~/core/state/networks/networks'; | ||
import { ChainId } from '~/core/types/chains'; | ||
import { NewTransaction, TxHash } from '~/core/types/transactions'; | ||
import { add } from '~/core/utils/numbers'; | ||
|
@@ -60,17 +60,20 @@ export const estimateSwapGasLimit = async ({ | |
const provider = getProvider({ chainId }); | ||
|
||
if (!provider || !quote) { | ||
return getChainGasUnits(chainId).basic.swap; | ||
const chainGasUnits = networkStore.getState().getChainGasUnits(chainId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can pull this line out to line 61 and delete the duplicate line on 72 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can, but only wanted to grab it when/if we needed to in order to reduce calls to the network store. |
||
return chainGasUnits.basic.swap; | ||
} | ||
|
||
const isWrapNativeAsset = quote.swapType === SwapType.wrap; | ||
const isUnwrapNativeAsset = quote.swapType === SwapType.unwrap; | ||
|
||
// Wrap / Unwrap Eth | ||
if (isWrapNativeAsset || isUnwrapNativeAsset) { | ||
const chainGasUnits = networkStore.getState().getChainGasUnits(chainId); | ||
|
||
const default_estimate = isWrapNativeAsset | ||
? getChainGasUnits(chainId).wrapped.wrap | ||
: getChainGasUnits(chainId).wrapped.unwrap; | ||
? chainGasUnits.wrapped.wrap | ||
: chainGasUnits.wrapped.unwrap; | ||
try { | ||
const gasLimit = await estimateGasWithPadding({ | ||
transactionRequest: { | ||
|
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.
Can you provide any info on this one? I can make a ticket but making sure this was intentional.
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 for context: this failure has been happening since my PR was merged (#1830). I think something with the quotes changed and I need to fix it. I recommended skipping this for now so we have an actual working e2e in the meantime.