mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-04 12:10:50 +03:00
correct formatting of node id when retrieving router name
This commit is contained in:
parent
2936450981
commit
df7f71dbdf
@ -6,7 +6,8 @@ use serde_json::json;
|
||||
use std::collections::HashMap;
|
||||
use std::string::FromUtf8Error;
|
||||
use uqbar_process_lib::{
|
||||
get_typed_state, http, receive, set_state, Address, Message, Payload, Request, Response,
|
||||
get_typed_state, http, println, receive, set_state,
|
||||
Address, Message, Payload, Request, Response,
|
||||
};
|
||||
|
||||
wit_bindgen::generate!({
|
||||
@ -136,8 +137,6 @@ impl Guest for Component {
|
||||
None => {}
|
||||
}
|
||||
|
||||
println!("qns_indexer: starting at block {}", state.block);
|
||||
|
||||
match main(our, state) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
@ -148,6 +147,7 @@ impl Guest for Component {
|
||||
}
|
||||
|
||||
fn main(our: Address, mut state: State) -> anyhow::Result<()> {
|
||||
|
||||
// shove all state into net::net
|
||||
Request::new()
|
||||
.target((&our.node, "net", "sys", "uqbar"))
|
||||
@ -291,7 +291,7 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> {
|
||||
node.routers = routers_raw
|
||||
.iter()
|
||||
.map(|r| {
|
||||
let key = hex::encode(r);
|
||||
let key = format!("0x{}", hex::encode(r));
|
||||
match state.names.get(&key) {
|
||||
Some(name) => name.clone(),
|
||||
None => format!("proposed router did not exist: 0x{}", key),
|
||||
|
@ -621,7 +621,7 @@ async fn _networking_info_valid(rpc_url: String, ip: String, ws_port: u16, our:
|
||||
println!("1");
|
||||
return false;
|
||||
};
|
||||
let Ok(qns_address): Result<EthAddress, _> = _QNS_SEPOLIA_ADDRESS.parse() else {
|
||||
let Ok(qns_address): Result<EthAddress, _> = QNS_SEPOLIA_ADDRESS.parse() else {
|
||||
println!("2");
|
||||
return false;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user