Skip to content

Commit

Permalink
fixup typo
Browse files Browse the repository at this point in the history
  • Loading branch information
baichuan3 committed Feb 17, 2025
1 parent 5ec91f1 commit 7405395
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions crates/rooch-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl RoochDB {
let state_change_set_ext = state_change_set_ext_opt.unwrap();

let mut object_ids = vec![];
for (_filed_key, object_change) in state_change_set_ext.state_change_set.changes.clone()
for (_field_key, object_change) in state_change_set_ext.state_change_set.changes.clone()
{
collect_revert_object_change_ids(object_change, &mut object_ids)?;
}
Expand Down Expand Up @@ -334,7 +334,7 @@ impl RoochDB {
let mut state_index_generator = IndexerObjectStatesIndexGenerator::default();
let mut indexer_object_state_change_set = IndexerObjectStateChangeSet::default();

for (_filed_key, object_change) in state_change_set_ext.state_change_set.changes.clone()
for (_field_key, object_change) in state_change_set_ext.state_change_set.changes.clone()
{
handle_revert_object_change(
&mut state_index_generator,
Expand All @@ -352,7 +352,7 @@ impl RoochDB {
let field_indexer_ids = list_field_indexer_keys(&resolver)?;

let mut field_object_ids = vec![];
for (_filed_key, object_change) in state_change_set_ext.state_change_set.changes.clone()
for (_field_key, object_change) in state_change_set_ext.state_change_set.changes.clone()
{
collect_revert_field_change_ids(
&field_indexer_ids,
Expand Down
10 changes: 5 additions & 5 deletions crates/rooch-indexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ impl IndexerStoreTrait for IndexerStore {
.delete_fields_by_id(ids)
}

fn apply_fields(&self, mut filed_changes: IndexerFieldChanges) -> Result<(), IndexerError> {
let mut fields_new_and_update = filed_changes.new_fields;
fields_new_and_update.append(&mut filed_changes.update_fields);
fn apply_fields(&self, mut field_changes: IndexerFieldChanges) -> Result<(), IndexerError> {
let mut fields_new_and_update = field_changes.new_fields;
fields_new_and_update.append(&mut field_changes.update_fields);
self.persist_or_update_fields(fields_new_and_update)?;
self.delete_fields(filed_changes.remove_fields)?;
self.delete_fields_by_id(filed_changes.remove_fields_by_id)
self.delete_fields(field_changes.remove_fields)?;
self.delete_fields_by_id(field_changes.remove_fields_by_id)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rooch-indexer/src/store/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ pub trait IndexerStoreTrait: Send + Sync {

fn delete_fields_by_id(&self, ids: Vec<String>) -> Result<(), IndexerError>;

fn apply_fields(&self, filed_changes: IndexerFieldChanges) -> Result<(), IndexerError>;
fn apply_fields(&self, field_changes: IndexerFieldChanges) -> Result<(), IndexerError>;
}
10 changes: 5 additions & 5 deletions crates/rooch/src/commands/statedb/commands/genesis_ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub(crate) fn apply_inscription_updates(
) {
let mut inscription_store_state_root = *GENESIS_STATE_ROOT;
let mut last_inscription_store_state_root = inscription_store_state_root;
let mut inscritpion_store_filed_count = 0u32;
let mut inscritpion_store_field_count = 0u32;
let mut cursed_inscription_count = 0u32;
let mut blessed_inscription_count = 0u32;
let moveos_store = moveos_store_arc.as_ref();
Expand All @@ -172,11 +172,11 @@ pub(crate) fn apply_inscription_updates(
apply_nodes(moveos_store, nodes).expect("failed to apply inscription nodes");
let apply_nodes_cost = apply_nodes_start.elapsed();

inscritpion_store_filed_count += cnt as u32;
inscritpion_store_field_count += cnt as u32;

println!(
"{} inscription applied ({} cursed, {} blessed). this batch: value size: {}, cost: {:?}(gen_nodes: {:?}, apply_nodes: {:?})",
inscritpion_store_filed_count / 2, // both inscription and inscription_id as field
inscritpion_store_field_count / 2, // both inscription and inscription_id as field
cursed_inscription_count,
blessed_inscription_count,
humanize::human_readable_bytes(batch.updates_value_bytes),
Expand All @@ -198,7 +198,7 @@ pub(crate) fn apply_inscription_updates(

println!(
"genesis InscriptionStore object updated, state_root: {:?}, cursed: {}, blessed: {}, total: {}",
inscription_store_state_root, cursed_inscription_count, blessed_inscription_count, inscritpion_store_filed_count / 2
inscription_store_state_root, cursed_inscription_count, blessed_inscription_count, inscritpion_store_field_count / 2
);

let act_stats = InscriptionStats {
Expand All @@ -207,7 +207,7 @@ pub(crate) fn apply_inscription_updates(
blessed_inscription_count,
unbound_inscription_count: exp_stats.unbound_inscription_count,
lost_sats: exp_stats.lost_sats,
next_sequence_number: inscritpion_store_filed_count / 2,
next_sequence_number: inscritpion_store_field_count / 2,
};
assert_eq!(act_stats, exp_stats, "Inscription stats not match");
}
4 changes: 2 additions & 2 deletions moveos/moveos-store/src/state_store/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl StateDBMetrics {
.unwrap(),
state_update_fields_bytes: register_histogram_vec_with_registry!(
"state_update_fields_bytes",
"State update fileds data size in bytes",
"State update fields data size in bytes",
&["fn_name"],
prometheus::exponential_buckets(1.0, 4.0, 15)
.unwrap()
Expand Down Expand Up @@ -93,7 +93,7 @@ impl StateDBMetrics {
.unwrap(),
state_get_field_at_bytes: register_histogram_vec_with_registry!(
"state_get_field_at_bytes",
"State get filed data size in bytes",
"State get field data size in bytes",
&["fn_name"],
prometheus::exponential_buckets(1.0, 4.0, 15)
.unwrap()
Expand Down
4 changes: 2 additions & 2 deletions third_party/move/language/move-analyzer/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2365,9 +2365,9 @@ pub fn on_document_symbol_request(context: &Context, request: &Request, symbols:
/// Helper function to handle struct fields
#[allow(deprecated)]
fn handle_struct_fields(struct_def: StructDef, fields: &mut Vec<DocumentSymbol>) {
let clonded_fileds = struct_def.field_defs;
let clonded_fields = struct_def.field_defs;

for field_def in clonded_fileds {
for field_def in clonded_fields {
let field_range = Range {
start: field_def.start,
end: field_def.start,
Expand Down

0 comments on commit 7405395

Please sign in to comment.