Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed May 29, 2024
1 parent d2cf9f3 commit 7d783e2
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions crates/rooch-rpc-api/src/jsonrpc_types/move_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ pub type AccountAddressView = StrView<AccountAddress>;
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)
}
}

impl FromStr for AccountAddressView {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
// AccountAddress::from_str suppport both 0xADDRESS and ADDRESS
// AccountAddress::from_str support both 0xADDRESS and ADDRESS
Ok(StrView(AccountAddress::from_str(s)?))
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rooch-rpc-server/src/server/rooch_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rooch-rpc-server/src/service/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
6 changes: 3 additions & 3 deletions crates/rooch/src/commands/account/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl CommandAction<()> for ListCommand {
};

let accounts: Vec<LocalAccount> = context.keystore.get_accounts(password)?;
let accont_views: Vec<AccountView> = accounts
let account_views: Vec<AccountView> = accounts
.into_iter()
.map(|account: LocalAccount| {
let active = Some(account.address) == active_address;
Expand All @@ -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!(
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/rooch/src/commands/account/commands/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl CommandAction<ExecuteTransactionResponseView> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl CommandAction<ExecuteTransactionResponseView> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,17 +542,17 @@ fn modify_modules(
.map(|b| CompiledModule::deserialize(&b))
.collect::<PartialVMResult<Vec<CompiledModule>>>()?;

let mut remapped_bubdles = vec![];
let mut remapped_bundles = vec![];
for module in compiled_modules.iter_mut() {
replace_fn(module)?;
let mut binary: Vec<u8> = vec![];
module.serialize(&mut binary).map_err(|e| {
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)
}

Expand Down
4 changes: 2 additions & 2 deletions moveos/metrics/src/op_counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions moveos/moveos-object-runtime/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion moveos/moveos-types/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
})?;
Expand Down
2 changes: 1 addition & 1 deletion moveos/moveos-wasm/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions moveos/moveos/src/vm/tx_argument_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ where
Ok(resolved_args)
}

pub fn load_arguments(&mut self, resovled_args: Vec<ResolvedArg>) -> VMResult<Vec<Vec<u8>>> {
pub fn load_arguments(&mut self, resolved_args: Vec<ResolvedArg>) -> VMResult<Vec<Vec<u8>>> {
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())
Expand Down
2 changes: 1 addition & 1 deletion moveos/moveos/src/vm/unit_tests/vm_arguments_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7d783e2

Please sign in to comment.