diff --git a/crates/rooch-rpc-api/src/jsonrpc_types/move_types.rs b/crates/rooch-rpc-api/src/jsonrpc_types/move_types.rs index bb6d7982f9..5c6a4d5bf8 100644 --- a/crates/rooch-rpc-api/src/jsonrpc_types/move_types.rs +++ b/crates/rooch-rpc-api/src/jsonrpc_types/move_types.rs @@ -43,7 +43,7 @@ pub type AccountAddressView = StrView; impl std::fmt::Display for AccountAddressView { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { //Ensure append `0x` before the address, and output full address - //The Display implemention of AccountAddress has not `0x` prefix + //The Display implementation of AccountAddress has not `0x` prefix write!(f, "{:#x}", self.0) } } @@ -51,7 +51,7 @@ impl std::fmt::Display for AccountAddressView { impl FromStr for AccountAddressView { type Err = anyhow::Error; fn from_str(s: &str) -> Result { - // AccountAddress::from_str suppport both 0xADDRESS and ADDRESS + // AccountAddress::from_str support both 0xADDRESS and ADDRESS Ok(StrView(AccountAddress::from_str(s)?)) } } diff --git a/crates/rooch-rpc-server/src/server/rooch_server.rs b/crates/rooch-rpc-server/src/server/rooch_server.rs index 2b7dd69f3d..6e81aafc42 100644 --- a/crates/rooch-rpc-server/src/server/rooch_server.rs +++ b/crates/rooch-rpc-server/src/server/rooch_server.rs @@ -135,7 +135,7 @@ impl RoochAPIServer for RoochServer { info!("send_raw_transaction tx: {:?}", tx); let hash = tx.tx_hash(); - self.rpc_service.quene_tx(tx).await?; + self.rpc_service.queue_tx(tx).await?; Ok(hash.into()) } diff --git a/crates/rooch-rpc-server/src/service/rpc_service.rs b/crates/rooch-rpc-server/src/service/rpc_service.rs index 41c69283fc..e47ec979aa 100644 --- a/crates/rooch-rpc-server/src/service/rpc_service.rs +++ b/crates/rooch-rpc-server/src/service/rpc_service.rs @@ -62,8 +62,8 @@ impl RpcService { Ok(self.executor.bitcoin_network().await?.network) } - pub async fn quene_tx(&self, tx: RoochTransaction) -> Result<()> { - //TODO implement quene tx and do not wait to execute + pub async fn queue_tx(&self, tx: RoochTransaction) -> Result<()> { + //TODO implement queue tx and do not wait to execute let _ = self.execute_tx(tx).await?; Ok(()) } diff --git a/crates/rooch/src/commands/account/commands/list.rs b/crates/rooch/src/commands/account/commands/list.rs index 296d555f10..031c2b55a8 100644 --- a/crates/rooch/src/commands/account/commands/list.rs +++ b/crates/rooch/src/commands/account/commands/list.rs @@ -68,7 +68,7 @@ impl CommandAction<()> for ListCommand { }; let accounts: Vec = context.keystore.get_accounts(password)?; - let accont_views: Vec = accounts + let account_views: Vec = accounts .into_iter() .map(|account: LocalAccount| { let active = Some(account.address) == active_address; @@ -80,7 +80,7 @@ impl CommandAction<()> for ListCommand { .collect(); if self.json { - println!("{}", serde_json::to_string_pretty(&accont_views).unwrap()); + println!("{}", serde_json::to_string_pretty(&account_views).unwrap()); } else { //TODO optimize the output format println!( @@ -94,7 +94,7 @@ impl CommandAction<()> for ListCommand { ); println!("{}", ["-"; 68].join("")); - for account in accont_views { + for account in account_views { println!( "{:^66} | {:^66} | {:^48} | {:^48} | {:^10} | {:^10}", account.local_account.address, diff --git a/crates/rooch/src/commands/account/commands/transfer.rs b/crates/rooch/src/commands/account/commands/transfer.rs index 387e2f265b..e6a6ccd645 100644 --- a/crates/rooch/src/commands/account/commands/transfer.rs +++ b/crates/rooch/src/commands/account/commands/transfer.rs @@ -58,7 +58,7 @@ impl CommandAction for TransferCommand { let tx_data = context .build_tx_data(sender, action, max_gas_amount) .await?; - //TODO the authenticator usually is associalted with the RoochTransactinData + //TODO the authenticator usually is associated with the RoochTransactinData //So we need to find a way to let user generate the authenticator based on the tx_data. let tx = RoochTransaction::new(tx_data, authenticator.into()); context.execute(tx).await diff --git a/crates/rooch/src/commands/move_cli/commands/run_function.rs b/crates/rooch/src/commands/move_cli/commands/run_function.rs index 3b2febcb17..d512b354c0 100644 --- a/crates/rooch/src/commands/move_cli/commands/run_function.rs +++ b/crates/rooch/src/commands/move_cli/commands/run_function.rs @@ -82,7 +82,7 @@ impl CommandAction for RunFunction { let tx_data = context .build_tx_data(sender, action, max_gas_amount) .await?; - //TODO the authenticator usually is associalted with the RoochTransactinData + //TODO the authenticator usually is associated with the RoochTransactinData //So we need to find a way to let user generate the authenticator based on the tx_data. let tx = RoochTransaction::new(tx_data, authenticator.into()); context.execute(tx).await diff --git a/frameworks/moveos-stdlib/src/natives/moveos_stdlib/move_module.rs b/frameworks/moveos-stdlib/src/natives/moveos_stdlib/move_module.rs index 2b68f6aac7..cfe192a26e 100644 --- a/frameworks/moveos-stdlib/src/natives/moveos_stdlib/move_module.rs +++ b/frameworks/moveos-stdlib/src/natives/moveos_stdlib/move_module.rs @@ -542,7 +542,7 @@ fn modify_modules( .map(|b| CompiledModule::deserialize(&b)) .collect::>>()?; - let mut remapped_bubdles = vec![]; + let mut remapped_bundles = vec![]; for module in compiled_modules.iter_mut() { replace_fn(module)?; let mut binary: Vec = vec![]; @@ -550,9 +550,9 @@ fn modify_modules( PartialVMError::new(StatusCode::VALUE_SERIALIZATION_ERROR).with_message(e.to_string()) })?; let value = Value::vector_u8(binary); - remapped_bubdles.push(value); + remapped_bundles.push(value); } - let output_modules = Vector::pack(&Type::Vector(Box::new(Type::U8)), remapped_bubdles)?; + let output_modules = Vector::pack(&Type::Vector(Box::new(Type::U8)), remapped_bundles)?; Ok(output_modules) } diff --git a/moveos/metrics/src/op_counters.rs b/moveos/metrics/src/op_counters.rs index 9808d45ac5..d18949ca95 100644 --- a/moveos/metrics/src/op_counters.rs +++ b/moveos/metrics/src/op_counters.rs @@ -33,7 +33,7 @@ impl DurationHistogram { } pub fn observe_duration(&self, d: Duration) { - // Duration is full seconds + nanos elapsed from the presious full second + // Duration is full seconds + nanos elapsed from the previous full second let v = d.as_secs() as f64 + f64::from(d.subsec_nanos()) / 1e9; self.histogram.observe(v); } @@ -132,7 +132,7 @@ impl OpMetrics { } pub fn observe_duration(&self, op: &str, d: Duration) { - // Duration is full seconds + nanos elapsed from the presious full second + // Duration is full seconds + nanos elapsed from the previous full second let v = d.as_secs() as f64 + f64::from(d.subsec_nanos()) / 1e9; self.duration_histograms.with_label_values(&[op]).observe(v); } diff --git a/moveos/moveos-object-runtime/src/runtime.rs b/moveos/moveos-object-runtime/src/runtime.rs index d57aec5b8d..9076857995 100644 --- a/moveos/moveos-object-runtime/src/runtime.rs +++ b/moveos/moveos-object-runtime/src/runtime.rs @@ -591,8 +591,8 @@ impl ObjectRuntime { .map_err(|e| e.finish(Location::Undefined)) } - pub fn load_arguments(&mut self, resovled_args: &[ResolvedArg]) -> VMResult<()> { - for resolved_arg in resovled_args { + pub fn load_arguments(&mut self, resolved_args: &[ResolvedArg]) -> VMResult<()> { + for resolved_arg in resolved_args { if let ResolvedArg::Object(object_arg) = resolved_arg { let object_id = object_arg.object_id(); self.load_object_reference(object_id)?; diff --git a/moveos/moveos-types/src/state.rs b/moveos/moveos-types/src/state.rs index 7ac9330f52..b02cdfb140 100644 --- a/moveos/moveos-types/src/state.rs +++ b/moveos/moveos-types/src/state.rs @@ -534,7 +534,7 @@ pub trait MoveStructState: MoveState + MoveStructType + DeserializeOwned + Seria .simple_serialize(&Self::struct_layout()) .ok_or_else(|| { anyhow::anyhow!( - "Serilaize the MoveState to bytes error: {:?}", + "Serialize the MoveState to bytes error: {:?}", Self::type_tag() ) })?; diff --git a/moveos/moveos-wasm/src/wasm.rs b/moveos/moveos-wasm/src/wasm.rs index f0f5b48c88..4ffbef5abb 100644 --- a/moveos/moveos-wasm/src/wasm.rs +++ b/moveos/moveos-wasm/src/wasm.rs @@ -174,7 +174,7 @@ pub fn put_data_on_stack(instance: &mut WASMInstance, data: &[u8]) -> anyhow::Re let data_len = data.len() as i32; let result = stack_alloc_func.call(&mut instance.store, vec![I32(data_len + 1)].as_slice())?; let return_value = match result.deref().first() { - None => return Err(anyhow::Error::msg("call StaclAlloc function failed")), + None => return Err(anyhow::Error::msg("call stackAlloc function failed")), Some(v) => v, }; let offset = match return_value.i32() { diff --git a/moveos/moveos/src/vm/tx_argument_resolver.rs b/moveos/moveos/src/vm/tx_argument_resolver.rs index 2b9e1271b0..c24f1512cb 100644 --- a/moveos/moveos/src/vm/tx_argument_resolver.rs +++ b/moveos/moveos/src/vm/tx_argument_resolver.rs @@ -178,10 +178,10 @@ where Ok(resolved_args) } - pub fn load_arguments(&mut self, resovled_args: Vec) -> VMResult>> { + pub fn load_arguments(&mut self, resolved_args: Vec) -> VMResult>> { let mut object_runtime = self.object_runtime.write(); - object_runtime.load_arguments(&resovled_args)?; - Ok(resovled_args + object_runtime.load_arguments(&resolved_args)?; + Ok(resolved_args .into_iter() .map(|arg| arg.into_serialized_arg()) .collect()) diff --git a/moveos/moveos/src/vm/unit_tests/vm_arguments_tests.rs b/moveos/moveos/src/vm/unit_tests/vm_arguments_tests.rs index 4655e62764..f17f14ec7d 100644 --- a/moveos/moveos/src/vm/unit_tests/vm_arguments_tests.rs +++ b/moveos/moveos/src/vm/unit_tests/vm_arguments_tests.rs @@ -869,7 +869,7 @@ fn call_missing_item() { let module = empty_module(); let id = &module.self_id(); let function_name = IdentStr::new("foo").unwrap(); - // mising module + // missing module let moveos_vm = MoveOSVM::new(vec![], VMConfig::default()).unwrap(); let mut remote_view = RemoteStore::new(); let ctx = TxContext::random_for_testing_only();