MCPcopy Create free account
hub / github.com/base/base / blind

Method blind

crates/proof/mpt/src/node.rs:112–122  ·  view source on GitHub ↗

Blinds the [`TrieNode`].. Alternatively, if the [`TrieNode`] is a [`TrieNode::Blinded`] node already, its commitment is returned directly.

(&self)

Source from the content-addressed store, hash-verified

110 /// Blinds the [`TrieNode`].. Alternatively, if the [`TrieNode`] is a [`TrieNode::Blinded`] node
111 /// already, its commitment is returned directly.
112 pub fn blind(&self) -> B256 {
113 match self {
114 Self::Blinded { commitment } => *commitment,
115 Self::Empty => EMPTY_ROOT_HASH,
116 _ => {
117 let mut rlp_buf = Vec::with_capacity(self.length());
118 self.encode(&mut rlp_buf);
119 keccak256(rlp_buf)
120 }
121 }
122 }
123
124 /// Unblinds the [`TrieNode`] if it is a [`TrieNode::Blinded`] node.
125 pub fn unblind<F: TrieProvider>(&mut self, fetcher: &F) -> TrieNodeResult<()> {

Callers 6

state_rootMethod · 0.80
update_accountsMethod · 0.80
trieFunction · 0.80
encodeMethod · 0.80

Calls 2

lengthMethod · 0.45
encodeMethod · 0.45

Tested by 1