From b6c8b5a7f1930f8cd2a6581f3ba4e4b83158720f Mon Sep 17 00:00:00 2001 From: irriden Date: Mon, 16 Oct 2023 22:13:10 +0000 Subject: [PATCH] tester: read command from cmd.json file --- tester/cmd.json | 4 +--- tester/src/ctrl.rs | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/tester/cmd.json b/tester/cmd.json index 9aa1ecf..52353ed 100644 --- a/tester/cmd.json +++ b/tester/cmd.json @@ -1,3 +1 @@ -{ - "type": "GetNonce" -} +"Nonce" diff --git a/tester/src/ctrl.rs b/tester/src/ctrl.rs index 717fa9b..fa1e208 100644 --- a/tester/src/ctrl.rs +++ b/tester/src/ctrl.rs @@ -25,13 +25,7 @@ async fn main() -> anyhow::Result<()> { let seed = hex::decode(seed_string).expect("yo"); let mut ctrl = controller_from_seed(&Network::Regtest, &seed, nonce); - let mut command = ControlMessage::Nonce; - if let Ok(cmd_content) = std::fs::read_to_string("./tester/cmd.json") { - if let Ok(cmd) = serde_json::from_str::(&cmd_content) { - command = cmd; - } - } - + let command = serde_json::from_str::(&std::fs::read_to_string("./cmd.json").unwrap()).unwrap(); println!("COMMAND! {:?}", command); let msg = ctrl.build_msg(command)?;