Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

imp(operator): genesis output flag improved #89

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e/interchaintestv8/sp1_ics07_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (s *SP1ICS07TendermintTestSuite) SetupSuite(ctx context.Context) {
s.Require().NoError(operator.RunGenesis(
"--trust-level", testvalues.DefaultTrustLevel.String(),
"--trusting-period", strconv.Itoa(testvalues.DefaultTrustPeriod),
"-o", "contracts/script/genesis.json",
))

stdout, _, err := eth.ForgeScript(ctx, s.UserA.KeyName(), ethereum.ForgeScriptOpts{
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ genesis:
@echo "Building the program..."
just build-programs
@echo "Generating the genesis file..."
RUST_LOG=info cargo run --bin operator --release -- genesis
RUST_LOG=info cargo run --bin operator --release -- genesis -o contracts/script/genesis.json

# Generate the fixture files for the Celestia Mocha testnet using the prover parameter.
# The prover parameter should be one of: ["mock", "network", "local"]
Expand Down
2 changes: 1 addition & 1 deletion operator/src/cli/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub mod genesis {
pub trusted_block: Option<u32>,

/// Genesis path.
#[clap(long, default_value = "../contracts/script")]
#[clap(long, short = 'o', default_value = "./genesis.json")]
pub genesis_path: String,

/// Trust options
Expand Down
5 changes: 2 additions & 3 deletions operator/src/runners/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use alloy_sol_types::SolValue;
use serde_with::serde_as;
use sp1_ics07_tendermint_solidity::sp1_ics07_tendermint::ConsensusState as SolConsensusState;
use sp1_sdk::{utils::setup_logger, HashableKey};
use std::{env, path::PathBuf};
use std::path::PathBuf;
use tendermint_light_client_verifier::types::{LightBlock, TrustThreshold};
use tendermint_rpc::HttpClient;

Expand Down Expand Up @@ -105,9 +105,8 @@ pub async fn run(args: Args) -> anyhow::Result<()> {
)
.await?;

let fixture_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(args.genesis_path);
std::fs::write(
fixture_path.join("genesis.json"),
PathBuf::from(args.genesis_path),
serde_json::to_string_pretty(&genesis).unwrap(),
)
.unwrap();
Expand Down
Loading