Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed Mar 7, 2025
1 parent 85aa3e3 commit 0bcf892
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/katana/cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,22 +713,22 @@ chain_id.Named = "Mainnet"

#[test]
fn http_modules() {
// If the `--http.api` isn't specified, only starknet module will be exposed.
// If the `--rpc.api` isn't specified, only starknet module will be exposed.
let config = NodeArgs::parse_from(["katana"]).config().unwrap();
let modules = config.rpc.apis;
assert_eq!(modules.len(), 1);
assert!(modules.contains(&RpcModuleKind::Starknet));

// If the `--http.api` is specified, only the ones in the list will be exposed.
let config = NodeArgs::parse_from(["katana", "--http.api", "saya,torii"]).config().unwrap();
// If the `--rpc.api` is specified, only the ones in the list will be exposed.
let config = NodeArgs::parse_from(["katana", "--rpc.api", "saya,torii"]).config().unwrap();
let modules = config.rpc.apis;
assert_eq!(modules.len(), 2);
assert!(modules.contains(&RpcModuleKind::Saya));
assert!(modules.contains(&RpcModuleKind::Torii));

// Specifiying the dev module without enabling dev mode is forbidden.
let err =
NodeArgs::parse_from(["katana", "--http.api", "starknet,dev"]).config().unwrap_err();
NodeArgs::parse_from(["katana", "--rpc.api", "starknet,dev"]).config().unwrap_err();
assert!(
err.to_string()
.contains("The `dev` module can only be enabled in dev mode (ie `--dev` flag)")
Expand Down

0 comments on commit 0bcf892

Please sign in to comment.