Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/crates/app/src/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where
Codec: WalCodec<Ctx>,
{
let wal_dir = home_dir.join("wal");
std::fs::create_dir_all(&wal_dir).unwrap();
std::fs::create_dir_all(&wal_dir)?;

let wal_file = wal_dir.join("consensus.wal");

Expand Down
8 changes: 5 additions & 3 deletions code/crates/discovery/src/handlers/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ where
}
// Add the address to the Kademlia routing table
if self.config.bootstrap_protocol == BootstrapProtocol::Kademlia {
swarm
.behaviour_mut()
.add_address(&peer_id, info.listen_addrs.first().unwrap().clone());
if let Some(addr) = info.listen_addrs.first() {
swarm.behaviour_mut().add_address(&peer_id, addr.clone());
} else {
warn!(peer = %peer_id, "No listen addresses available for Kademlia routing");
}
}
} else {
// If discovery is disabled, all peers are inbound. The
Expand Down
14 changes: 11 additions & 3 deletions code/crates/test/app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,17 @@ pub async fn run(state: &mut State, channels: &mut Channels<TestContext>) -> eyr
let decided_value = state.get_decided_value(height).await;
info!(%height, "Found decided value: {decided_value:?}");

let raw_decided_value = decided_value.map(|decided_value| RawDecidedValue {
certificate: decided_value.certificate,
value_bytes: JsonCodec.encode(&decided_value.value).unwrap(), // FIXME: unwrap
let raw_decided_value = decided_value.and_then(|decided_value| {
match JsonCodec.encode(&decided_value.value) {
Ok(value_bytes) => Some(RawDecidedValue {
certificate: decided_value.certificate,
value_bytes,
}),
Err(e) => {
error!(%height, "Failed to encode decided value: {e}");
None
}
}
});

if reply.send(raw_decided_value).is_err() {
Expand Down