fix simulation-mode

This commit is contained in:
hosted-fornet 2024-05-21 21:06:26 -07:00
parent 2978bf5935
commit 10b4b6f9a3
2 changed files with 10 additions and 6 deletions

View File

@ -7,7 +7,7 @@ use alloy_rpc_types::request::{TransactionInput, TransactionRequest};
use alloy_signer::{LocalWallet, Signer, SignerSync};
use alloy_sol_types::{SolCall, SolValue};
use alloy_transport_ws::WsConnect;
use lib::core::Identity;
use lib::core::{Identity, NodeRouting};
use std::str::FromStr;
pub mod helpers;
@ -191,7 +191,10 @@ pub async fn assign_ws_local_helper(
));
}
our.ws_routing = Some((node_ip, ws));
our.routing = NodeRouting::Direct {
ip: node_ip,
ports: std::collections::BTreeMap::from([("ws".to_string(), ws)]),
};
}
Ok(())
}

View File

@ -523,8 +523,7 @@ pub async fn simulate_node(
"0x{}",
hex::encode(decoded.networking_keypair.public_key().as_ref())
),
ws_routing: None,
allowed_routers: decoded.routers.clone(),
routing: NodeRouting::Routers(decoded.routers.clone()),
};
fakenet::assign_ws_local_helper(
@ -556,8 +555,10 @@ pub async fn simulate_node(
let identity = Identity {
name: name.clone(),
networking_key: pubkey,
ws_routing: Some(("127.0.0.1".into(), ws_port)),
allowed_routers: vec![],
routing: NodeRouting::Direct {
ip: "127.0.0.1".into(),
ports: std::collections::BTreeMap::from([("ws".to_string(), ws_port)]),
}
};
let decoded_keyfile = Keyfile {