mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-18 15:54:31 +01:00
update deps
This commit is contained in:
@@ -8,7 +8,7 @@ use clap::{App, AppSettings, Arg};
|
||||
use dotenv::dotenv;
|
||||
use rumqttc::{self, AsyncClient, Event, EventLoop, MqttOptions, Packet, QoS};
|
||||
use sphinx_signer::sphinx_glyph::control::Controller;
|
||||
use sphinx_signer::vls_protocol::{model::PubKey, msgs};
|
||||
use sphinx_signer::vls_protocol::msgs;
|
||||
use sphinx_signer::{self};
|
||||
use std::convert::TryInto;
|
||||
use std::env;
|
||||
@@ -109,17 +109,11 @@ async fn run_main(
|
||||
match eventloop.poll().await {
|
||||
Ok(event) => {
|
||||
println!("{:?}", event);
|
||||
let dummy_peer = PubKey([0; 33]);
|
||||
if let Some((topic, msg_bytes)) = incoming_bytes(event) {
|
||||
println!("MSG BYTES {:}", msg_bytes.len());
|
||||
match topic.as_str() {
|
||||
topics::VLS => {
|
||||
match sphinx_signer::root::handle(
|
||||
&root_handler,
|
||||
msg_bytes,
|
||||
dummy_peer.clone(),
|
||||
is_log,
|
||||
) {
|
||||
match sphinx_signer::root::handle(&root_handler, msg_bytes, is_log) {
|
||||
Ok(b) => client
|
||||
.publish(topics::VLS_RETURN, QoS::AtMostOnce, false, b)
|
||||
.await
|
||||
@@ -180,18 +174,17 @@ async fn run_test(
|
||||
if let Some((topic, msg_bytes)) = incoming_bytes(event) {
|
||||
match topic.as_str() {
|
||||
topics::VLS => {
|
||||
let (ping, sequence, dbid): (msgs::Ping, u16, u64) =
|
||||
parser::request_from_bytes(msg_bytes).expect("read ping header");
|
||||
let (ping, header) =
|
||||
parser::request_from_bytes::<msgs::Ping>(msg_bytes)
|
||||
.expect("read ping header");
|
||||
if is_log {
|
||||
println!("sequence {}", sequence);
|
||||
println!("dbid {}", dbid);
|
||||
println!("INCOMING: {:?}", ping);
|
||||
}
|
||||
let pong = msgs::Pong {
|
||||
id: ping.id,
|
||||
message: ping.message,
|
||||
};
|
||||
let bytes = parser::raw_response_from_msg(pong, sequence)
|
||||
let bytes = parser::raw_response_from_msg(pong, header.sequence)
|
||||
.expect("couldnt parse raw response");
|
||||
client
|
||||
.publish(topics::VLS_RETURN, QoS::AtMostOnce, false, bytes)
|
||||
|
||||
Reference in New Issue
Block a user