Skip to content

Commit

Permalink
remove sim_panic rpc
Browse files Browse the repository at this point in the history
looks like this was only here to simulate a panic from the rpc end.
why you ask? i guess we will never know!
  • Loading branch information
mariocynicys committed Nov 8, 2024
1 parent e65fefe commit 400b452
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion mm2src/mm2_main/src/rpc/dispatcher/dispatcher_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ pub fn dispatcher(req: Json, ctx: MmArc) -> DispatcherRes {
"order_status" => hyres(order_status(ctx, req)),
"orderbook" => hyres(orderbook_rpc(ctx, req)),
"orderbook_depth" => hyres(orderbook_depth_rpc(ctx, req)),
"sim_panic" => hyres(sim_panic(req)),
"recover_funds_of_swap" => hyres(recover_funds_of_swap(ctx, req)),
"sell" => hyres(sell(ctx, req)),
"show_priv_key" => hyres(show_priv_key(ctx, req)),
Expand Down
30 changes: 0 additions & 30 deletions mm2src/mm2_main/src/rpc/lp_commands/lp_commands_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,36 +259,6 @@ pub async fn stop(ctx: MmArc) -> Result<Response<Vec<u8>>, String> {
Ok(try_s!(Response::builder().body(res)))
}

pub async fn sim_panic(req: Json) -> Result<Response<Vec<u8>>, String> {
#[derive(Deserialize)]
struct Req {
#[serde(default)]
mode: String,
}
let req: Req = try_s!(json::from_value(req));

#[derive(Serialize)]
struct Ret<'a> {
/// Supported panic modes.
#[serde(skip_serializing_if = "Vec::is_empty")]
modes: Vec<Cow<'a, str>>,
}
let ret: Ret;

if req.mode.is_empty() {
ret = Ret {
modes: vec!["simple".into()],
}
} else if req.mode == "simple" {
panic!("sim_panic: simple")
} else {
return ERR!("No such mode: {}", req.mode);
}

let js = try_s!(json::to_vec(&ret));
Ok(try_s!(Response::builder().body(js)))
}

pub fn version(ctx: MmArc) -> HyRes {
match json::to_vec(&MmVersionResponse {
result: ctx.mm_version.clone(),
Expand Down

0 comments on commit 400b452

Please sign in to comment.