Skip to content

Conversation

@al3mart
Copy link
Member

@al3mart al3mart commented Sep 30, 2025

Adds fork to pop cli.

Initially implemented in two different modules: chain and contract as it might be valuable in the future.
A priori forking a contract might not seem to provide extra value over forking a whole chain as if the chain is host to certain contracts these are brought with the chain' state.

But there might be space for optimizations such that we only pick certain state from certain contracts addresses explicitly provided by the user.

Although the initial path to implementation is forking live chains, I've gone ahead and include the command structure for now as it was not any extra effort.

@al3mart al3mart requested a review from AlexD10S September 30, 2025 22:20
pub(crate) struct ForkArgs {
/// Entrypoint of the fork command.
#[command(subcommand)]
pub(crate) command: Command,
Copy link
Member Author

Choose a reason for hiding this comment

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

could be an Option and if no subcommand is provided to fork default to fork chain

@al3mart al3mart marked this pull request as draft September 30, 2025 22:23
@al3mart al3mart force-pushed the al3mart/pop-fork-cli branch from 64c8afe to 0ec86fa Compare September 30, 2025 23:09
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 64.51613% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.09%. Comparing base (c85f2a1) to head (2ae6093).

Files with missing lines Patch % Lines
crates/pop-cli/src/commands/mod.rs 75.00% 5 Missing ⚠️
crates/pop-cli/src/commands/fork/chain.rs 0.00% 3 Missing ⚠️
crates/pop-cli/src/commands/fork/contract.rs 0.00% 3 Missing ⚠️
@@                Coverage Diff                @@
##           feat/pop-fork     #651      +/-   ##
=================================================
- Coverage          77.10%   77.09%   -0.02%     
=================================================
  Files                109      112       +3     
  Lines              24753    24784      +31     
  Branches           24753    24784      +31     
=================================================
+ Hits               19087    19107      +20     
- Misses              3663     3674      +11     
  Partials            2003     2003              
Files with missing lines Coverage Δ
crates/pop-cli/src/commands/fork/mod.rs 100.00% <100.00%> (ø)
crates/pop-cli/src/commands/fork/chain.rs 0.00% <0.00%> (ø)
crates/pop-cli/src/commands/fork/contract.rs 0.00% <0.00%> (ø)
crates/pop-cli/src/commands/mod.rs 68.49% <75.00%> (+0.65%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@al3mart al3mart force-pushed the al3mart/pop-fork-cli branch from 0ec86fa to 2ae6093 Compare October 30, 2025 16:06
@al3mart al3mart force-pushed the al3mart/pop-fork-cli branch from 2ae6093 to 806a846 Compare December 8, 2025 08:41
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