Skip to content

Commit

Permalink
rename all l1 references to settlement
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Dec 19, 2024
1 parent f93b119 commit 89f3861
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions bin/katana/src/cli/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,24 @@ struct InitInput {

// the id of the new chain to be initialized.
id: String,

// the chain id of the settlement layer.
l1_id: String,
settlement_id: String,

// the rpc url for the settlement layer.
l1_rpc_url: Url,
rpc_url: Url,

fee_token: ContractAddress,

settlement_contract: ContractAddress,

// path at which the config file will be written at.
output_path: PathBuf,
}

#[derive(Debug, Serialize, Deserialize)]

Check warning on line 49 in bin/katana/src/cli/init/mod.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/init/mod.rs#L49

Added line #L49 was not covered by tests
#[serde(rename_all = "kebab-case")]
pub struct L1 {
pub struct SettlementLayer {
// the account address that was used to initialized the l1 deployments
pub account: ContractAddress,

Expand Down Expand Up @@ -77,7 +82,7 @@ pub struct InitConfiguration {
// this corresponds to the l1 token contract
pub fee_token: ContractAddress,

pub l1: L1,
pub settlement: SettlementLayer,
}

#[derive(Debug, Args)]
Expand All @@ -97,10 +102,10 @@ impl InitArgs {
let output = InitConfiguration {
id: input.id,
fee_token: ContractAddress::default(),
l1: L1 {
settlement: SettlementLayer {
account: input.account,
id: input.l1_id,
rpc_url: input.l1_rpc_url,
id: input.settlement_id,
rpc_url: input.rpc_url,
fee_token: input.fee_token,
bridge_contract: ContractAddress::default(),
settlement_contract: input.settlement_contract,
Expand All @@ -116,7 +121,7 @@ impl InitArgs {
fn prompt(&self, rt: &Runtime) -> Result<InitInput> {
let chain_id = Text::new("Id").prompt()?;

Check warning on line 122 in bin/katana/src/cli/init/mod.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/init/mod.rs#L121-L122

Added lines #L121 - L122 were not covered by tests

let url = CustomType::<Url>::new("L1 RPC URL")
let url = CustomType::<Url>::new("Settlement RPC URL")
.with_default(Url::parse("http://localhost:5050")?)
.with_error_message("Please enter a valid URL")
.prompt()?;

Check warning on line 127 in bin/katana/src/cli/init/mod.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/init/mod.rs#L124-L127

Added lines #L124 - L127 were not covered by tests
Expand Down Expand Up @@ -185,10 +190,10 @@ impl InitArgs {
Ok(InitInput {
account: account_address,
settlement_contract,
l1_id: parse_cairo_short_string(&l1_chain_id)?,
settlement_id: parse_cairo_short_string(&l1_chain_id)?,
id: chain_id,
fee_token,
l1_rpc_url: url,
rpc_url: url,
output_path,

Check warning on line 197 in bin/katana/src/cli/init/mod.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/init/mod.rs#L191-L197

Added lines #L191 - L197 were not covered by tests
})
}

Check warning on line 199 in bin/katana/src/cli/init/mod.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/init/mod.rs#L199

Added line #L199 was not covered by tests
Expand Down

0 comments on commit 89f3861

Please sign in to comment.