fix: feature-gate std-only methods in sparse trie (#17706)

This commit is contained in:
Federico Gimenez
2025-08-01 19:10:24 +02:00
committed by GitHub
parent 7d660b57b0
commit db779ed9db

View File

@@ -843,12 +843,14 @@ impl<S: SparseTrieInterface + Default> StorageTries<S> {
/// Takes the storage trie for the account from the internal `HashMap`, creating it if it
/// doesn't already exist.
#[cfg(feature = "std")]
fn take_or_create_trie(&mut self, account: &B256) -> SparseTrie<S> {
self.tries.remove(account).unwrap_or_else(|| self.cleared_tries.pop().unwrap_or_default())
}
/// Takes the revealed paths set from the account from the internal `HashMap`, creating one if
/// it doesn't exist.
#[cfg(feature = "std")]
fn take_or_create_revealed_paths(&mut self, account: &B256) -> HashSet<Nibbles> {
self.revealed_paths
.remove(account)