Skip to content

Commit

Permalink
feat: Treat 'run' as default command (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc authored Jun 27, 2024
1 parent 5862c6a commit f8e2b97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
tar -xzf era_test_node-${{ matrix.os }}.tar.gz
chmod +x era_test_node
echo "Starting node in background"
./era_test_node run 2>&1 | tee era_test_node_output.log &
./era_test_node 2>&1 | tee era_test_node_output.log &
echo "PID=$!" >> $GITHUB_ENV
- name: Launch tests
Expand Down
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ enum DevSystemContracts {
#[command(author = "Matter Labs", version, about = "Test Node", long_about = None)]
struct Cli {
#[command(subcommand)]
command: Command,
command: Option<Command>,
#[arg(long, default_value = "8011")]
/// Port to listen on - default: 8011
port: u16,
Expand Down Expand Up @@ -335,7 +335,9 @@ async fn main() -> anyhow::Result<()> {
},
};

let fork_details = match &opt.command {
// Use `Command::Run` as default.
let command = opt.command.as_ref().unwrap_or(&Command::Run);
let fork_details = match &command {
Command::Run => None,
Command::Fork(fork) => {
Some(ForkDetails::from_network(&fork.network, fork.fork_at, cache_config).await)
Expand All @@ -347,7 +349,7 @@ async fn main() -> anyhow::Result<()> {

// If we're replaying the transaction, we need to sync to the previous block
// and then replay all the transactions that happened in
let transactions_to_replay = if let Command::ReplayTx(replay_tx) = &opt.command {
let transactions_to_replay = if let Command::ReplayTx(replay_tx) = command {
fork_details
.as_ref()
.unwrap()
Expand Down

0 comments on commit f8e2b97

Please sign in to comment.