Skip to content

Commit

Permalink
fix(iota): more typos (#943)
Browse files Browse the repository at this point in the history
* fix(iota): more typos

* more typos

* more typos

* one more typo

* remove comment

---------

Co-authored-by: DaughterOfMars <[email protected]>
  • Loading branch information
thibault-martinez and DaughterOfMars authored Jul 4, 2024
1 parent 23146d0 commit a3dc12b
Show file tree
Hide file tree
Showing 36 changed files with 122 additions and 121 deletions.
2 changes: 1 addition & 1 deletion consensus/core/src/block_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl BlockVerifier for SignedBlockVerifier {
});
}

// Verifiy the block's signature.
// Verify the block's signature.
block.verify_signature(&self.context)?;

// Verify the block's ancestor refs are consistent with the block's round,
Expand Down
34 changes: 17 additions & 17 deletions consensus/core/src/tests/base_committer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
#[test]
fn try_direct_commit() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -77,7 +77,7 @@ fn try_direct_commit() {
#[test]
fn idempotence() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -121,7 +121,7 @@ fn idempotence() {
#[test]
fn multiple_direct_commit() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -162,7 +162,7 @@ fn multiple_direct_commit() {
#[test]
fn direct_skip() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -214,7 +214,7 @@ fn direct_skip() {
#[test]
fn indirect_commit() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -357,7 +357,7 @@ fn indirect_commit() {
#[test]
fn indirect_skip() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -411,7 +411,7 @@ fn indirect_skip() {
dag_state.clone(),
));

// Add enough blocks to reach the decison round of wave 3.
// Add enough blocks to reach the decision round of wave 3.
let decision_round_wave_3 = committer.decision_round(3);
build_dag(
context.clone(),
Expand Down Expand Up @@ -487,7 +487,7 @@ fn indirect_skip() {
#[test]
fn undecided() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -576,7 +576,7 @@ fn undecided() {
#[test]
fn test_byzantine_direct_commit() {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down Expand Up @@ -659,19 +659,19 @@ fn test_byzantine_direct_commit() {
// non-votes C13 but there are enough good votes to prevent a skip.
// Additionally only one of the non-votes per authority should be counted so
// we should not skip leader A12.
let decison_block_a14 = VerifiedBlock::new_for_test(
let decision_block_a14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 0)
.set_ancestors(good_references_voting_round_wave_4.clone())
.build(),
);
dag_state.write().accept_block(decison_block_a14.clone());
dag_state.write().accept_block(decision_block_a14.clone());

let good_references_voting_round_wave_4_without_c13 = good_references_voting_round_wave_4
.into_iter()
.filter(|r| r.author != AuthorityIndex::new_for_test(2))
.collect::<Vec<_>>();

let decison_block_b14 = VerifiedBlock::new_for_test(
let decision_block_b14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 1)
.set_ancestors(
good_references_voting_round_wave_4_without_c13
Expand All @@ -682,9 +682,9 @@ fn test_byzantine_direct_commit() {
)
.build(),
);
dag_state.write().accept_block(decison_block_b14.clone());
dag_state.write().accept_block(decision_block_b14.clone());

let decison_block_c14 = VerifiedBlock::new_for_test(
let decision_block_c14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 2)
.set_ancestors(
good_references_voting_round_wave_4_without_c13
Expand All @@ -695,9 +695,9 @@ fn test_byzantine_direct_commit() {
)
.build(),
);
dag_state.write().accept_block(decison_block_c14.clone());
dag_state.write().accept_block(decision_block_c14.clone());

let decison_block_d14 = VerifiedBlock::new_for_test(
let decision_block_d14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 3)
.set_ancestors(
good_references_voting_round_wave_4_without_c13
Expand All @@ -708,7 +708,7 @@ fn test_byzantine_direct_commit() {
)
.build(),
);
dag_state.write().accept_block(decison_block_d14.clone());
dag_state.write().accept_block(decision_block_d14.clone());

// DagState Update:
// - We have A13, B13, D13 & C13 as good votes in the voting round of wave 4
Expand Down
26 changes: 13 additions & 13 deletions consensus/core/src/tests/pipelined_committer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,20 +655,20 @@ fn test_byzantine_validator() {
// Additionally only one of the non-votes per authority should be counted so
// we should not skip leader A12.
let mut references_round_14 = vec![];
let decison_block_a14 = VerifiedBlock::new_for_test(
let decision_block_a14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 0)
.set_ancestors(good_references_voting_round_wave_4.clone())
.build(),
);
references_round_14.push(decison_block_a14.reference());
dag_state.write().accept_block(decison_block_a14.clone());
references_round_14.push(decision_block_a14.reference());
dag_state.write().accept_block(decision_block_a14.clone());

let good_references_voting_round_wave_4_without_b13 = good_references_voting_round_wave_4
.into_iter()
.filter(|r| r.author != AuthorityIndex::new_for_test(1))
.collect::<Vec<_>>();

let decison_block_b14 = VerifiedBlock::new_for_test(
let decision_block_b14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 1)
.set_ancestors(
good_references_voting_round_wave_4_without_b13
Expand All @@ -679,10 +679,10 @@ fn test_byzantine_validator() {
)
.build(),
);
references_round_14.push(decison_block_b14.reference());
dag_state.write().accept_block(decison_block_b14.clone());
references_round_14.push(decision_block_b14.reference());
dag_state.write().accept_block(decision_block_b14.clone());

let decison_block_c14 = VerifiedBlock::new_for_test(
let decision_block_c14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 2)
.set_ancestors(
good_references_voting_round_wave_4_without_b13
Expand All @@ -693,10 +693,10 @@ fn test_byzantine_validator() {
)
.build(),
);
references_round_14.push(decison_block_c14.reference());
dag_state.write().accept_block(decison_block_c14.clone());
references_round_14.push(decision_block_c14.reference());
dag_state.write().accept_block(decision_block_c14.clone());

let decison_block_d14 = VerifiedBlock::new_for_test(
let decision_block_d14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 3)
.set_ancestors(
good_references_voting_round_wave_4_without_b13
Expand All @@ -707,8 +707,8 @@ fn test_byzantine_validator() {
)
.build(),
);
references_round_14.push(decison_block_d14.reference());
dag_state.write().accept_block(decison_block_d14.clone());
references_round_14.push(decision_block_d14.reference());
dag_state.write().accept_block(decision_block_d14.clone());

// DagState Update:
// - We have A13, B13, D13 & C13 as good votes in the voting round of leader A12
Expand Down Expand Up @@ -777,7 +777,7 @@ fn basic_test_setup() -> (
super::UniversalCommitter,
) {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down
18 changes: 9 additions & 9 deletions consensus/core/src/tests/universal_committer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,19 +664,19 @@ fn test_byzantine_direct_commit() {
// non-votes C13 but there are enough good votes to prevent a skip.
// Additionally only one of the non-votes per authority should be counted so
// we should not skip leader A12.
let decison_block_a14 = VerifiedBlock::new_for_test(
let decision_block_a14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 0)
.set_ancestors(good_references_voting_round_wave_4.clone())
.build(),
);
dag_state.write().accept_block(decison_block_a14.clone());
dag_state.write().accept_block(decision_block_a14.clone());

let good_references_voting_round_wave_4_without_c13 = good_references_voting_round_wave_4
.into_iter()
.filter(|r| r.author != AuthorityIndex::new_for_test(2))
.collect::<Vec<_>>();

let decison_block_b14 = VerifiedBlock::new_for_test(
let decision_block_b14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 1)
.set_ancestors(
good_references_voting_round_wave_4_without_c13
Expand All @@ -687,9 +687,9 @@ fn test_byzantine_direct_commit() {
)
.build(),
);
dag_state.write().accept_block(decison_block_b14.clone());
dag_state.write().accept_block(decision_block_b14.clone());

let decison_block_c14 = VerifiedBlock::new_for_test(
let decision_block_c14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 2)
.set_ancestors(
good_references_voting_round_wave_4_without_c13
Expand All @@ -700,9 +700,9 @@ fn test_byzantine_direct_commit() {
)
.build(),
);
dag_state.write().accept_block(decison_block_c14.clone());
dag_state.write().accept_block(decision_block_c14.clone());

let decison_block_d14 = VerifiedBlock::new_for_test(
let decision_block_d14 = VerifiedBlock::new_for_test(
TestBlock::new(14, 3)
.set_ancestors(
good_references_voting_round_wave_4_without_c13
Expand All @@ -713,7 +713,7 @@ fn test_byzantine_direct_commit() {
)
.build(),
);
dag_state.write().accept_block(decison_block_d14.clone());
dag_state.write().accept_block(decision_block_d14.clone());

// DagState Update:
// - We have A13, B13, D13 & C13 as good votes in the voting round of wave 4
Expand Down Expand Up @@ -747,7 +747,7 @@ fn basic_test_setup() -> (
super::UniversalCommitter,
) {
telemetry_subscribers::init_for_testing();
// Commitee of 4 with even stake
// Committee of 4 with even stake
let context = Arc::new(Context::new_for_test(4).0);
let dag_state = Arc::new(RwLock::new(DagState::new(
context.clone(),
Expand Down
4 changes: 2 additions & 2 deletions crates/data-transform/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ fn main() {
println!("Unable to find event_json {}", target_id);
}
Err(_) => {
println!("An error occured while fetching event_json {}", target_id);
println!("An error occurred while fetching event_json {}", target_id);
}
}

Expand Down Expand Up @@ -326,7 +326,7 @@ fn main() {
exit(0);
}
Err(_) => {
println!("An error occured while fetching event {}", target_id);
println!("An error occurred while fetching event {}", target_id);
exit(0);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// Test Identifer length limits
// Test identifier length limits

//# init --addresses Test=0x0

//# publish

/// Test Identifer length limits enforced for module name
/// Test identifier length limits enforced for module name
module Test::M1_1234567891234567890123456789012345678912345678901234567890123456789123456789012345678908901234567891234567890123456789078912345678901234567890 {

public entry fun create_n_idscreate_n_idscreate_n_() {
Expand All @@ -17,7 +17,7 @@ module Test::M1_1234567891234567890123456789012345678912345678901234567890123456

//# publish

/// Test Identifer length limits enforced for function name
/// Test identifier length limits enforced for function name
module Test::M1_12345678912345678901234567890 {
public entry fun create_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_idscreate_n_ids() {
}
Expand All @@ -26,7 +26,7 @@ module Test::M1_12345678912345678901234567890 {

//# publish

/// Test normal Identifer lengths
/// Test normal identifier lengths
module Test::M1_1234567891234567890123456789012345678912345678901234567 {

public entry fun create_n_(n: u64, ctx: &mut TxContext) {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-bridge/src/action_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ mod tests {
let action_digest = action.digest();

// Wait for 1 second. It should still in the process of retrying requesting sigs
// becaues we mock errors above.
// because we mock errors above.
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
tx_subscription.try_recv().unwrap_err();
// And the action is still in WAL
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-bridge/src/iota_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl IotaClientInner for IotaSdkClient {
}
};

// get_dynamic_field_object does not return bcs, so we have to issue anothe
// get_dynamic_field_object does not return bcs, so we have to issue another
// query
let bcs_bytes = self
.read_api()
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-bridge/src/server/governance_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct GovernanceVerifier {

impl GovernanceVerifier {
pub fn new(approved_actions: Vec<BridgeAction>) -> BridgeResult<Self> {
// TOOD(audit-blocking): verify chain ids
// TODO(audit-blocking): verify chain ids
let mut approved_goverance_actions = HashMap::new();
for action in approved_actions {
if !action.is_governace_action() {
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-bridge/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub fn mock_get_logs(
}

/// Returns a test Log and corresponding BridgeAction
// Refernece: https://github.com/rust-ethereum/ethabi/blob/master/ethabi/src/event.rs#L192
// Reference: https://github.com/rust-ethereum/ethabi/blob/master/ethabi/src/event.rs#L192
pub fn get_test_log_and_action(
contract_address: EthAddress,
tx_hash: TxHash,
Expand All @@ -199,7 +199,7 @@ pub fn get_test_log_and_action(
let source_address = EthAddress::random();
let iota_address: IotaAddress = IotaAddress::random_for_testing_only();
let target_address = Hex::decode(&iota_address.to_string()).unwrap();
// Note: must use `encode` rather than `encode_packged`
// Note: must use `encode` rather than `encode_packaged`
let encoded = ethers::abi::encode(&[
// u8 is encoded as u256 in abi standard
ethers::abi::Token::Uint(ethers::types::U256::from(token_code)),
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct NodeConfig {
#[serde(default = "default_enable_index_processing")]
pub enable_index_processing: bool,

// only alow websocket connections for jsonrpc traffic
// only allow websocket connections for jsonrpc traffic
#[serde(default)]
pub websocket_only: bool,

Expand Down
Loading

0 comments on commit a3dc12b

Please sign in to comment.