Skip to content
Closed
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
4 changes: 2 additions & 2 deletions bin/host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ use std::{
io::{stderr, stdin, stdout},
os::fd::{AsFd, AsRawFd},
panic::AssertUnwindSafe,
process::Command,
sync::Arc,
};
use tokio::{process::Command, sync::RwLock, task};
use tokio::{sync::RwLock, task};
use tracing::{error, info};
use util::Pipe;

Expand Down Expand Up @@ -222,7 +223,6 @@ pub async fn start_native_client_program(

let status = command
.status()
.await
.map_err(|e| {
error!(target: "client_program", "Failed to execute client program: {:?}", e);
anyhow!("Failed to execute client program: {:?}", e)
Expand Down
11 changes: 9 additions & 2 deletions crates/mpt/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ impl TrieNode {
}

/// Returns the commitment of a [TrieNode::Blinded] node, if `self` is of the
/// [TrieNode::Blinded] variant.
/// [TrieNode::Blinded] or [TrieNode::Empty] variants.
///
/// ## Returns
/// - `Some(B256)` - The commitment of the blinded node
/// - `None` - `self` is not a [TrieNode::Blinded] node
pub fn blinded_commitment(&self) -> Option<B256> {
match self {
TrieNode::Blinded { commitment } => Some(*commitment),
Self::Blinded { commitment } => Some(*commitment),
Self::Empty => Some(EMPTY_ROOT_HASH),
_ => None,
}
}
Expand Down Expand Up @@ -680,6 +681,12 @@ mod test {
use alloy_trie::{HashBuilder, Nibbles};
use rand::prelude::SliceRandom;

#[test]
fn test_empty_blinded() {
let trie_node = TrieNode::Empty;
assert_eq!(trie_node.blinded_commitment().unwrap(), EMPTY_ROOT_HASH);
}

#[test]
fn test_decode_branch() {
const BRANCH_RLP: [u8; 83] = hex!("f851a0eb08a66a94882454bec899d3e82952dcc918ba4b35a09a84acd98019aef4345080808080808080a05d87a81d9bbf5aee61a6bfeab3a5643347e2c751b36789d988a5b6b163d496518080808080808080");
Expand Down