Skip to content

Commit

Permalink
fix spelling of merkelized
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone authored and tzemanovic committed Jan 25, 2024
1 parent 790acb7 commit 050b5e8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion crates/apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ mod test_finalize_block {

/// Test that replay protection keys are not added to the merkle tree
#[test]
fn test_replay_keys_not_merkelized() {
fn test_replay_keys_not_merklized() {
let (mut shell, _, _, _) = setup();

let (wrapper_tx, processed_tx) =
Expand Down
8 changes: 3 additions & 5 deletions crates/apps/src/lib/node/ledger/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,8 @@ where
}

/// Merkle tree storage key filter. Return `false` for keys that shouldn't be
/// merkelized.
pub fn is_merkelized_storage_key(
key: &namada_sdk::types::storage::Key,
) -> bool {
/// merklized.
pub fn is_merklized_storage_key(key: &namada_sdk::types::storage::Key) -> bool {
!token::storage_key::is_masp_key(key)
&& !namada::ibc::storage::is_ibc_counter_key(key)
}
Expand Down Expand Up @@ -440,7 +438,7 @@ where
native_token,
db_cache,
config.shell.storage_read_past_height_limit,
is_merkelized_storage_key,
is_merklized_storage_key,
);
storage
.load_last_state()
Expand Down
20 changes: 10 additions & 10 deletions crates/apps/src/lib/node/ledger/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mod tests {
use tempfile::TempDir;

use super::*;
use crate::node::ledger::shell::is_merkelized_storage_key;
use crate::node::ledger::shell::is_merklized_storage_key;

#[test]
fn test_crud_value() {
Expand All @@ -90,7 +90,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);
let key = Key::parse("key").expect("cannot parse the key string");
let value: u64 = 1;
Expand Down Expand Up @@ -143,7 +143,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);
storage
.begin_block(BlockHash::default(), BlockHeight(100))
Expand Down Expand Up @@ -245,7 +245,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);
storage
.load_last_state()
Expand All @@ -270,7 +270,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);
storage
.begin_block(BlockHash::default(), BlockHeight(100))
Expand Down Expand Up @@ -317,7 +317,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);
storage
.begin_block(BlockHash::default(), BlockHeight(100))
Expand Down Expand Up @@ -385,7 +385,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);

// 1. For each `blocks_write_value`, write the current block height if
Expand Down Expand Up @@ -479,7 +479,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);

let num_keys = 5;
Expand Down Expand Up @@ -598,7 +598,7 @@ mod tests {
address::nam(),
None,
Some(5),
is_merkelized_storage_key,
is_merklized_storage_key,
);
let new_epoch_start = BlockHeight(1);
let signed_root_key = bridge_pool::get_signed_root_key();
Expand Down Expand Up @@ -704,7 +704,7 @@ mod tests {
address::nam(),
None,
None,
is_merkelized_storage_key,
is_merklized_storage_key,
);
let mut storage = WlStorage {
storage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ mod test_bridge_pool_vp {
address::nam(),
None,
None,
namada_sdk::state::merkelize_all_keys,
namada_sdk::state::merklize_all_keys,
),
write_log: Default::default(),
};
Expand Down
4 changes: 2 additions & 2 deletions crates/state/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub struct BlockStorage<H: StorageHasher> {
pub pred_epochs: Epochs,
}

pub fn merkelize_all_keys(_key: &storage::Key) -> bool {
pub fn merklize_all_keys(_key: &storage::Key) -> bool {
true
}

Expand Down Expand Up @@ -1151,7 +1151,7 @@ pub mod testing {
ethereum_height: None,
eth_events_queue: EthEventsQueue::default(),
storage_read_past_height_limit: Some(1000),
merkle_tree_key_filter: merkelize_all_keys,
merkle_tree_key_filter: merklize_all_keys,
}
}
}
Expand Down

0 comments on commit 050b5e8

Please sign in to comment.