Skip to content

Commit 3c2465c

Browse files
committed
chore(katana): rename prompt answer struct
1 parent 141914f commit 3c2465c

File tree

2 files changed

+27
-27
lines changed
  • bin/katana/src/cli/init
  • crates/katana/core/src/backend

2 files changed

+27
-27
lines changed

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use std::sync::Arc;
99
use anyhow::{Context, Result};
1010
use clap::Args;
1111
use inquire::{Confirm, CustomType};
12-
use katana_chain_spec::{SettlementLayer, DEV_UNALLOCATED};
12+
use katana_chain_spec::{DEV_UNALLOCATED, SettlementLayer};
1313
use katana_primitives::chain::ChainId;
14-
use katana_primitives::genesis::allocation::DevAllocationsGenerator;
1514
use katana_primitives::genesis::Genesis;
15+
use katana_primitives::genesis::allocation::DevAllocationsGenerator;
1616
use katana_primitives::{ContractAddress, Felt};
1717
use lazy_static::lazy_static;
1818
use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount};
@@ -23,27 +23,6 @@ use starknet::providers::{JsonRpcClient, Provider, Url};
2323
use starknet::signers::{LocalWallet, SigningKey};
2424
use tokio::runtime::Runtime;
2525

26-
#[derive(Debug)]
27-
struct InitInput {
28-
/// the account address that is used to send the transactions for contract
29-
/// deployment/initialization.
30-
account: ContractAddress,
31-
32-
// the id of the new chain to be initialized.
33-
id: String,
34-
35-
// the chain id of the settlement layer.
36-
settlement_id: String,
37-
38-
// the rpc url for the settlement layer.
39-
rpc_url: Url,
40-
41-
settlement_contract: ContractAddress,
42-
43-
// path at which the config file will be written at.
44-
output_path: PathBuf,
45-
}
46-
4726
#[derive(Debug, Args)]
4827
pub struct InitArgs {
4928
/// The path to where the config file will be written at.
@@ -74,7 +53,7 @@ impl InitArgs {
7453
chain_spec.store(input.output_path)
7554
}
7655

77-
fn prompt(&self, rt: &Runtime) -> Result<InitInput> {
56+
fn prompt(&self, rt: &Runtime) -> Result<PromptOutcome> {
7857
let chain_id = CustomType::<String>::new("Id")
7958
.with_help_message("This will be the id of your rollup chain.")
8059
// checks that the input is a valid ascii string.
@@ -158,7 +137,7 @@ impl InitArgs {
158137
.0
159138
};
160139

161-
Ok(InitInput {
140+
Ok(PromptOutcome {
162141
account: account_address,
163142
settlement_contract,
164143
settlement_id: parse_cairo_short_string(&l1_chain_id)?,
@@ -169,6 +148,27 @@ impl InitArgs {
169148
}
170149
}
171150

151+
#[derive(Debug)]
152+
struct PromptOutcome {
153+
/// the account address that is used to send the transactions for contract
154+
/// deployment/initialization.
155+
account: ContractAddress,
156+
157+
// the id of the new chain to be initialized.
158+
id: String,
159+
160+
// the chain id of the settlement layer.
161+
settlement_id: String,
162+
163+
// the rpc url for the settlement layer.
164+
rpc_url: Url,
165+
166+
settlement_contract: ContractAddress,
167+
168+
// path at which the config file will be written at.
169+
output_path: PathBuf,
170+
}
171+
172172
// > CONFIG_DIR/$chain_id/config.json
173173
fn config_path(id: &str) -> Result<PathBuf> {
174174
Ok(config_dir(id)?.join("config").with_extension("json"))

crates/katana/core/src/backend/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use katana_primitives::block::{
1010
use katana_primitives::da::L1DataAvailabilityMode;
1111
use katana_primitives::env::BlockEnv;
1212
use katana_primitives::receipt::{Event, ReceiptWithTxHash};
13-
use katana_primitives::state::{StateUpdates, compute_state_diff_hash};
13+
use katana_primitives::state::{compute_state_diff_hash, StateUpdates};
1414
use katana_primitives::transaction::{TxHash, TxWithHash};
1515
use katana_primitives::version::CURRENT_STARKNET_VERSION;
16-
use katana_primitives::{ContractAddress, Felt, address};
16+
use katana_primitives::{address, ContractAddress, Felt};
1717
use katana_provider::traits::block::{BlockHashProvider, BlockWriter};
1818
use katana_provider::traits::trie::TrieWriter;
1919
use katana_trie::compute_merkle_root;

0 commit comments

Comments
 (0)