mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 15:24:32 +01:00
tester: read command from cmd.json file
This commit is contained in:
@@ -1,3 +1 @@
|
|||||||
{
|
"Nonce"
|
||||||
"type": "GetNonce"
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -25,13 +25,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
let seed = hex::decode(seed_string).expect("yo");
|
let seed = hex::decode(seed_string).expect("yo");
|
||||||
let mut ctrl = controller_from_seed(&Network::Regtest, &seed, nonce);
|
let mut ctrl = controller_from_seed(&Network::Regtest, &seed, nonce);
|
||||||
|
|
||||||
let mut command = ControlMessage::Nonce;
|
let command = serde_json::from_str::<ControlMessage>(&std::fs::read_to_string("./cmd.json").unwrap()).unwrap();
|
||||||
if let Ok(cmd_content) = std::fs::read_to_string("./tester/cmd.json") {
|
|
||||||
if let Ok(cmd) = serde_json::from_str::<ControlMessage>(&cmd_content) {
|
|
||||||
command = cmd;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("COMMAND! {:?}", command);
|
println!("COMMAND! {:?}", command);
|
||||||
|
|
||||||
let msg = ctrl.build_msg(command)?;
|
let msg = ctrl.build_msg(command)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user