Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix some comments (#4017)
Signed-off-by: hishope <csqiye@126.com>
  • Loading branch information
hishope committed Mar 8, 2024
1 parent d0e1ed2 commit 65c06a3
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion cmd/starcoin/src/account/verify_sign_cmd.rs
Expand Up @@ -9,7 +9,7 @@ use scmd::{CommandAction, ExecContext};
use serde::{Deserialize, Serialize};
use starcoin_types::sign_message::SignedMessage;

/// Verify the the message signed by the sign command.
/// Verify the message signed by the sign command.
#[derive(Debug, Parser)]
#[clap(name = "verify-sign-message")]
pub struct VerifySignMessageOpt {
Expand Down
2 changes: 1 addition & 1 deletion commons/accumulator/src/node_index.rs
Expand Up @@ -155,7 +155,7 @@ impl NodeIndex {
/// This method takes in a node position and return its sibling position
///
/// The observation is that, after stripping out the right-most common bits,
/// two sibling nodes flip the the next right-most bits with each other.
/// two sibling nodes flip the next right-most bits with each other.
/// To find out the right-most common bits, first remove all the right-most ones
/// because they are corresponding to level's indicator. Then remove next zero right after.
pub fn sibling(self) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion network-p2p/src/protocol/event.rs
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Network event types. These are are not the part of the protocol, but rather
//! Network event types. These are not the part of the protocol, but rather
//! events that happen on the network like DHT get/put results received.

use bytes::Bytes;
Expand Down
2 changes: 1 addition & 1 deletion network/src/service.rs
Expand Up @@ -635,7 +635,7 @@ impl Inner {
.entry(peer_id.clone())
.and_modify(|peer| {
// avoid update chain status to old
// this many happend when multi protocol send repeat handhake.
// this many happened when multi protocol send repeat handshake.
//FIXME after PeerEvent refactor.
if chain_info.total_difficulty()
> peer.peer_info.chain_info.status().info.total_difficulty
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync_block.py
Expand Up @@ -20,7 +20,7 @@ def get_height(method, url, post_data, headers):

print("get_height response status is %s" % response.status)
if response.status != 200:
print("reponse is not ok, res is", j_res)
print("response is not ok, res is", j_res)
return 0
conn.close()
return j_res["result"]["head"]["number"]
Expand Down
2 changes: 1 addition & 1 deletion vm/compiler/src/dependency_order.rs
Expand Up @@ -27,7 +27,7 @@ struct ModuleIndex(usize);

impl<'a> DependencyGraph<'a> {
/// Construct a dependency graph from a set of `modules`.
/// Panics if `modules` contains duplicates or is not closed under the depedency relation
/// Panics if `modules` contains duplicates or is not closed under the dependency relation
pub fn new(module_iter: impl IntoIterator<Item = &'a CompiledModule>) -> Result<Self> {
let mut modules = vec![];
let mut reverse_modules = BTreeMap::new();
Expand Down
6 changes: 3 additions & 3 deletions vm/e2e-tests/src/account.rs
Expand Up @@ -309,7 +309,7 @@ impl TransactionBuilder {
}

//---------------------------------------------------------------------------
// CoinStore resource represenation
// CoinStore resource representation
//---------------------------------------------------------------------------

/// Struct that represents an account CoinStore resource for tests.
Expand Down Expand Up @@ -367,7 +367,7 @@ impl CoinStore {
}

//---------------------------------------------------------------------------
// Account type represenation
// Account type representation
//---------------------------------------------------------------------------

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -426,7 +426,7 @@ impl Default for AccountRoleSpecifier {
}

//---------------------------------------------------------------------------
// Account type resource represenation
// Account type resource representation
//---------------------------------------------------------------------------

/// Struct that represents an account type for testing.
Expand Down
4 changes: 2 additions & 2 deletions vm/mvhashmap/src/unit_tests/mvhashmap_test.rs
Expand Up @@ -23,14 +23,14 @@ fn create_write_read_placeholder_struct() {

let mvtbl = MVHashMap::new();

// Reads that should go the the DB return Err(None)
// Reads that should go the DB return Err(None)
let r_db = mvtbl.read(&ap1, 5);
assert_eq!(Err(None), r_db);

// Write by txn 10.
mvtbl.write(&ap1, (10, 1), value_for(10, 1));

// Reads that should go the the DB return Err(None)
// Reads that should go the DB return Err(None)
let r_db = mvtbl.read(&ap1, 9);
assert_eq!(Err(None), r_db);
// Reads return entries from smaller txns, not txn 10.
Expand Down
2 changes: 1 addition & 1 deletion vm/parallel-executor/src/executor.rs
Expand Up @@ -66,7 +66,7 @@ impl<'a, K: PartialOrd + Send + Clone + Hash + Eq, V: Send + Sync> MVHashMapView
// `self.txn_idx` estimated to depend on a write from `dep_idx`.
match self.scheduler.wait_for_dependency(self.txn_idx, dep_idx) {
Some(dep_condition) => {
// Wait on a condition variable correpsonding to the encountered
// Wait on a condition variable corresponding to the encountered
// read dependency. Once the dep_idx finishes re-execution, scheduler
// will mark the dependency as resolved, and then the txn_idx will be
// scheduled for re-execution, which will re-awaken cvar here.
Expand Down
2 changes: 1 addition & 1 deletion vm/parallel-executor/src/scheduler.rs
Expand Up @@ -121,7 +121,7 @@ pub struct Scheduler {
/// in particular, after aborts and executions that write outside of the write set of the
/// same transaction's previous incarnation.
validation_idx: AtomicUsize,
/// The the number of times execution_idx and validation_idx are decreased.
/// The number of times execution_idx and validation_idx are decreased.
decrease_cnt: AtomicUsize,

/// Number of tasks used to track when transactions can be committed, incremented / decremented
Expand Down
2 changes: 1 addition & 1 deletion vm/parallel-executor/src/txn_last_input_output.rs
Expand Up @@ -16,7 +16,7 @@ type TxnOutput<T, E> = ExecutionStatus<T, Error<E>>;
// If an entry was read from the multi-version data-structure, then kind is
// MVHashMap(txn_idx, incarnation), with transaction index and incarnation number
// of the execution associated with the write of the entry. Otherwise, if the read
// occured from storage, and kind is set to Storage.
// occurred from storage, and kind is set to Storage.
#[derive(Clone, PartialEq)]
enum ReadKind {
MVHashMap(TxnIndex, Incarnation),
Expand Down
4 changes: 2 additions & 2 deletions vm/types/src/on_chain_config/gas_schedule.rs
Expand Up @@ -233,7 +233,7 @@ pub fn native_gas_schedule_v1() -> Vec<(String, u64)> {
"starcoin_natives.signature.ed25519_verify.per_byte".to_string(),
gas_total(61, 1),
),
// ED25519_THRESHOLD_VERIFY 3 this native funciton is deprecated
// ED25519_THRESHOLD_VERIFY 3 this native function is deprecated
(
"move_stdlib.bcs.to_bytes.per_byte_serialized".to_string(),
gas_total(181, 1),
Expand Down Expand Up @@ -604,7 +604,7 @@ static G_NATIVE_STRS: Lazy<Vec<&str>> = Lazy::new(|| {
"move_stdlib.hash.sha2_256.per_byte",
"move_stdlib.hash.sha3_256.per_byte",
"starcoin_natives.signature.ed25519_verify.per_byte",
// ED25519_THRESHOLD_VERIFY 3 this native funciton is deprecated, ignore, use ""
// ED25519_THRESHOLD_VERIFY 3 this native function is deprecated, ignore, use ""
"",
"move_stdlib.bcs.to_bytes.per_byte_serialized",
"move_stdlib.vector.length.base",
Expand Down
2 changes: 1 addition & 1 deletion vm/types/src/transaction/authenticator.rs
Expand Up @@ -24,7 +24,7 @@ use starcoin_crypto::{
};
use std::{convert::TryFrom, fmt, str::FromStr};

/// A `TransactionAuthenticator` is an an abstraction of a signature scheme. It must know:
/// A `TransactionAuthenticator` is an abstraction of a signature scheme. It must know:
/// (1) How to check its signature against a message and public key
/// (2) How to convert its public key into an `AuthenticationKeyPreimage` structured as
/// (public_key | signature_scheme_id).
Expand Down
2 changes: 1 addition & 1 deletion vm/types/src/unit_tests/access_path_test.rs
Expand Up @@ -67,7 +67,7 @@ fn test_bad_case_from_protest() {
let access_path = AccessPath::from_str(raw_path);
assert!(access_path.is_ok());

//The module name start with '_' will will encounter parse error
//The module name start with '_' will encounter parse error
//This may be the parser error, or the identity's arbitrary error
let raw_path = "0x00000000000000000000000000000001/1/0x00000000000000000000000000000001::_a::A";
let access_path = AccessPath::from_str(raw_path);
Expand Down
16 changes: 8 additions & 8 deletions workspaceify.py
Expand Up @@ -89,35 +89,35 @@ def replace_package(self):
:return:
"""
decoder = toml.TomlDecoder()
pacakge = self.toml_dict['package']
package = self.toml_dict['package']

authors = decoder.get_empty_inline_table()
authors['workspace'] = True
pacakge['authors'] = authors
package['authors'] = authors

edition = decoder.get_empty_inline_table()
edition['workspace'] = True
pacakge['edition'] = edition
package['edition'] = edition

homepage = decoder.get_empty_inline_table()
homepage['workspace'] = True
pacakge['homepage'] = homepage
package['homepage'] = homepage

license = decoder.get_empty_inline_table()
license['workspace'] = True
pacakge['license'] = license
package['license'] = license

publish = decoder.get_empty_inline_table()
publish['workspace'] = True
pacakge['publish'] = publish
package['publish'] = publish

repository = decoder.get_empty_inline_table()
repository['workspace'] = True
pacakge['repository'] = repository
package['repository'] = repository

rustversion = decoder.get_empty_inline_table()
rustversion['workspace'] = True
pacakge['rust-version'] = rustversion
package['rust-version'] = rustversion

def replace_dependencies(self, is_dev=False):
depends = self.get_dependencies(is_dev)
Expand Down

0 comments on commit 65c06a3

Please sign in to comment.