diff --git a/rpc-toolkit/tests/handler.rs b/rpc-toolkit/tests/handler.rs index 1410845..299100a 100644 --- a/rpc-toolkit/tests/handler.rs +++ b/rpc-toolkit/tests/handler.rs @@ -90,7 +90,7 @@ fn make_api() -> ParentHandler { ParentHandler::new() .subcommand( "echo", - ParentHandler::::new() + ParentHandler::::new() .subcommand_no_cli( "echo_no_cli", from_fn(|c: CliContext| { @@ -131,6 +131,34 @@ fn make_api() -> ParentHandler { |InheritParams { donde }, _| donde, ), ) + .subcommand( + "fizz", + ParentHandler::::new().root_handler( + from_fn(|c: CliContext, _, InheritParams { donde }| { + Ok::<_, RpcError>( + format!( + "Subcommand No Cli: Host {host} Donde = {donde}", + host = c.host(), + ) + .to_string(), + ) + }), + |id, _| id, + ), + ) + .subcommand( + "error", + ParentHandler::::new().root_handler_no_cli( + from_fn(|c: CliContext, _, InheritParams { donde }| { + Err::(RpcError { + code: 1, + message: "This is an example message".into(), + data: None, + }) + }), + |id, _| id, + ), + ) } pub fn internal_error(e: impl Display) -> RpcError {