Skip to content

Commit

Permalink
fix(cli): simplify world config output
Browse files Browse the repository at this point in the history
Removed unnecessary unwrap_or pattern in config world output within
describe, create, and update commands. Updated schema to reflect
NON_NULL world type.
  • Loading branch information
steebchen committed Nov 8, 2024
1 parent 2d8ea94 commit 5e72541
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
5 changes: 1 addition & 4 deletions cli/src/command/deployments/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ impl CreateArgs {
}
ToriiConfig(config) => {
println!("\nConfiguration:");
println!(
" World: {}",
config.world.unwrap_or_else(|| "0x0".to_string())
);
println!(" World: {}", config.world);
println!(" RPC: {}", config.rpc);
if let Some(contracts) = config.contracts {
println!(" Contracts: {}", contracts);
Expand Down
5 changes: 1 addition & 4 deletions cli/src/command/deployments/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ impl DescribeArgs {
ToriiConfig(config) => {
println!("\nConfiguration:");
println!(" Version: {}", config.version);
println!(
" World: {}",
config.world.unwrap_or_else(|| "0x0".to_string())
);
println!(" World: {}", config.world);
println!(" RPC: {}", config.rpc);
if let Some(contracts) = config.contracts {
println!(" Contracts: {}", contracts);
Expand Down
5 changes: 1 addition & 4 deletions cli/src/command/deployments/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ impl UpdateArgs {
match data.update_deployment {
ToriiConfig(config) => {
println!("\nConfiguration:");
println!(
" World: {}",
config.world.unwrap_or_else(|| "0x0".to_string())
);
println!(" World: {}", config.world);
println!(" RPC: {}", config.rpc);
println!(" Start Block: {}", config.start_block.unwrap_or(0));
println!(" Index Pending: {}", config.index_pending.unwrap_or(false));
Expand Down
10 changes: 7 additions & 3 deletions slot/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16396,9 +16396,13 @@
"isDeprecated": false,
"name": "world",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
{
Expand Down

0 comments on commit 5e72541

Please sign in to comment.