-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add fork block number and selector on fork exit #61
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: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -46,11 +46,12 @@ func NewEnterFork( | |
|
|
||
| // EnterForkParams contains parameters for entering fork mode | ||
| type EnterForkParams struct { | ||
| Network string // network name from foundry.toml | ||
| RPCURL string // resolved RPC URL (after env var expansion) | ||
| ChainID uint64 // chain ID | ||
| EnvVarName string // env var name that foundry.toml uses for the RPC endpoint | ||
| ExternalURL string // optional external Anvil endpoint URL (skips local Anvil startup) | ||
| Network string // network name from foundry.toml | ||
| RPCURL string // resolved RPC URL (after env var expansion) | ||
| ChainID uint64 // chain ID | ||
| EnvVarName string // env var name that foundry.toml uses for the RPC endpoint | ||
| ExternalURL string // optional external Anvil endpoint URL (skips local Anvil startup) | ||
| ForkBlockNumber uint64 // optional block number to fork at (0 = latest) | ||
| } | ||
|
Comment on lines
+49
to
55
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. Reject
🤖 Prompt for AI Agents |
||
|
|
||
| // EnterForkResult contains the result of entering fork mode | ||
|
|
@@ -144,12 +145,13 @@ func (uc *EnterFork) executeLocal(ctx context.Context, state *domain.ForkState, | |
| } | ||
|
|
||
| instance := &domain.AnvilInstance{ | ||
| Name: fmt.Sprintf("fork-%s", params.Network), | ||
| Port: fmt.Sprintf("%d", port), | ||
| ChainID: fmt.Sprintf("%d", params.ChainID), | ||
| ForkURL: params.RPCURL, | ||
| PidFile: filepath.Join(privDir, fmt.Sprintf("fork-%s.pid", params.Network)), | ||
| LogFile: filepath.Join(privDir, fmt.Sprintf("fork-%s.log", params.Network)), | ||
| Name: fmt.Sprintf("fork-%s", params.Network), | ||
| Port: fmt.Sprintf("%d", port), | ||
| ChainID: fmt.Sprintf("%d", params.ChainID), | ||
| ForkURL: params.RPCURL, | ||
| ForkBlockNumber: params.ForkBlockNumber, | ||
| PidFile: filepath.Join(privDir, fmt.Sprintf("fork-%s.pid", params.Network)), | ||
| LogFile: filepath.Join(privDir, fmt.Sprintf("fork-%s.log", params.Network)), | ||
|
Comment on lines
+148
to
+154
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. Persist the pinned block number in fork state. This only sets 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| // Start anvil (includes CreateX deployment) | ||
|
|
||
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.
Keep the no-arg
fork exithelp text in sync with this behavior.Lines 155-156 still say the no-arg form uses the currently configured network, but this branch now ignores that and chooses from the active-fork set instead. Either preserve the old fallback before this switch or update the command help in the same change.
🤖 Prompt for AI Agents