mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-02 08:02:23 +03:00
swap routers back to default, print error on app store state deserialize
This commit is contained in:
parent
598b1d2d24
commit
6f67f9b8f6
@ -56,17 +56,18 @@ impl OnchainMetadata {
|
||||
/// fetch state from disk or create a new one if that fails
|
||||
pub fn fetch_state(our: Address, provider: eth::Provider) -> State {
|
||||
if let Some(state_bytes) = get_state() {
|
||||
if let Ok(state) = serde_json::from_slice::<SerializedState>(&state_bytes) {
|
||||
if state.contract_address == CONTRACT_ADDRESS {
|
||||
return State::from_serialized(our, provider, state);
|
||||
} else {
|
||||
println!(
|
||||
"state contract address mismatch! expected {}, got {}",
|
||||
CONTRACT_ADDRESS, state.contract_address
|
||||
);
|
||||
match serde_json::from_slice::<SerializedState>(&state_bytes) {
|
||||
Ok(state) => {
|
||||
if state.contract_address == CONTRACT_ADDRESS {
|
||||
return State::from_serialized(our, provider, state);
|
||||
} else {
|
||||
println!(
|
||||
"state contract address mismatch! expected {}, got {}",
|
||||
CONTRACT_ADDRESS, state.contract_address
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println!("failed to deserialize saved state");
|
||||
Err(e) => println!("failed to deserialize saved state: {e}"),
|
||||
}
|
||||
}
|
||||
State::new(our, provider, CONTRACT_ADDRESS.to_string()).expect("state creation failed")
|
||||
|
@ -73,10 +73,9 @@ pub async fn register(
|
||||
("tcp".to_string(), tcp_port),
|
||||
]),
|
||||
routers: vec![
|
||||
// "default-router-1.os".into(),
|
||||
// "default-router-2.os".into(),
|
||||
// "default-router-3.os".into(),
|
||||
"default-router-7.os".into(),
|
||||
"default-router-1.os".into(),
|
||||
"default-router-2.os".into(),
|
||||
"default-router-3.os".into(),
|
||||
],
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user