From 92e32c4b3c94b6e058adf16240e9f9ec0a3834be Mon Sep 17 00:00:00 2001 From: DanHenton Date: Mon, 23 Jan 2023 14:42:34 +1300 Subject: [PATCH 1/3] use non binary pronouns in comments --- bin/utils/subkey/README.md | 2 +- client/beefy/src/tests.rs | 6 +++--- client/consensus/babe/src/lib.rs | 2 +- docs/README.adoc | 4 ++-- frame/contracts/src/exec.rs | 4 ++-- frame/elections-phragmen/src/benchmarking.rs | 2 +- frame/nfts/src/features/transfer.rs | 2 +- frame/nomination-pools/src/migration.rs | 2 +- frame/nomination-pools/test-staking/src/lib.rs | 2 +- frame/root-offences/src/tests.rs | 4 ++-- frame/staking/src/tests.rs | 2 +- frame/uniques/src/functions.rs | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/utils/subkey/README.md b/bin/utils/subkey/README.md index e762a42c3e79e..768f1335ccdf9 100644 --- a/bin/utils/subkey/README.md +++ b/bin/utils/subkey/README.md @@ -255,7 +255,7 @@ Secret Key URI `0x8c9a73097f235b84021a446bc2826a00c690ea0be3e0d81a84931cb4146d66 SS58 Address: 1bobYxBPjZWRPbVo35aSwci1u5Zmq8P6J2jpa4kkudBZMqE ``` -`Bob` now got a nice address starting with his name: 1**bob**YxBPjZWRPbVo35aSwci1u5Zmq8P6J2jpa4kkudBZMqE. +`Bob` now got a nice address starting with their name: 1**bob**YxBPjZWRPbVo35aSwci1u5Zmq8P6J2jpa4kkudBZMqE. **Note**: While `Bob`, having a short name (3 chars), got a result rather quickly, it will take much longer for `Alice` who has a much longer name, thus the chances to generate a random address that contains the chain `alice` will be much smaller. diff --git a/client/beefy/src/tests.rs b/client/beefy/src/tests.rs index 66d3a210d7eba..ec04a42eec170 100644 --- a/client/beefy/src/tests.rs +++ b/client/beefy/src/tests.rs @@ -151,7 +151,7 @@ impl BeefyTestNet { ) -> Vec { let mut all_hashes = Vec::with_capacity(count + 1); - // make sure genesis is the only block in network, so we can insert genesis at he beginning + // make sure genesis is the only block in network, so we can insert genesis at the beginning // of hashes, otherwise indexing would be broken assert!(self.peer(0).client().as_backend().blockchain().hash(1).unwrap().is_none()); @@ -926,7 +926,7 @@ async fn on_demand_beefy_justification_sync() { ) .await; - // Spawn Dave, he's now way behind voting and can only catch up through on-demand justif sync. + // Spawn Dave, they are now way behind voting and can only catch up through on-demand justif sync. tokio::spawn(dave_task); // give Dave a chance to spawn and init. run_for(Duration::from_millis(400), &net).await; @@ -937,7 +937,7 @@ async fn on_demand_beefy_justification_sync() { client.finalize_block(hashes[1], None).unwrap(); // Give Dave task some cpu cycles to process the finality notification, run_for(Duration::from_millis(100), &net).await; - // freshly spun up Dave now needs to listen for gossip to figure out the state of his peers. + // freshly spun up Dave now needs to listen for gossip to figure out the state of their peers. // Have the other peers do some gossip so Dave finds out about their progress. finalize_block_and_wait_for_beefy(&net, fast_peers, &[hashes[25]], &[25]).await; diff --git a/client/consensus/babe/src/lib.rs b/client/consensus/babe/src/lib.rs index c9e171dbed887..06a736de30a1f 100644 --- a/client/consensus/babe/src/lib.rs +++ b/client/consensus/babe/src/lib.rs @@ -1461,7 +1461,7 @@ where // this way we can revert it if there's any error let mut old_epoch_changes = None; - // Use an extra scope to make the compiler happy, because otherwise he complains about the + // Use an extra scope to make the compiler happy, because otherwise it complains about the // mutex, even if we dropped it... let mut epoch_changes = { let mut epoch_changes = self.epoch_changes.shared_data_locked(); diff --git a/docs/README.adoc b/docs/README.adoc index 5d7b0b52c5250..8e43757d10fb2 100644 --- a/docs/README.adoc +++ b/docs/README.adoc @@ -297,7 +297,7 @@ Detailed logs may be shown by running the node with the following environment va If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two validator nodes for Alice and Bob, who are the initial authorities of the genesis chain specification that have been endowed with a testnet DOTs. We'll give each node a name and expose them so they are listed on link:https://telemetry.polkadot.io/#/Local%20Testnet[Telemetry]. You'll need two terminal windows open. -We'll start Alice's Substrate node first on default TCP port 30333 with her chain database stored locally at `/tmp/alice`. The Bootnode ID of her node is `QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR`, which is generated from the `--node-key` value that we specify below: +We'll start Alice's Substrate node first on default TCP port 30333 with their chain database stored locally at `/tmp/alice`. The Bootnode ID of Alice's node is `QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR`, which is generated from the `--node-key` value that we specify below: [source, shell] cargo run --release \-- \ @@ -308,7 +308,7 @@ cargo run --release \-- \ --telemetry-url 'ws://telemetry.polkadot.io:1024 0' \ --validator -In the second terminal, we'll run the following to start Bob's Substrate node on a different TCP port of 30334, and with his chain database stored locally at `/tmp/bob`. We'll specify a value for the `--bootnodes` option that will connect his node to Alice's Bootnode ID on TCP port 30333: +In the second terminal, we'll run the following to start Bob's Substrate node on a different TCP port of 30334, and with their chain database stored locally at `/tmp/bob`. We'll specify a value for the `--bootnodes` option that will connect Bob's node to Alice's Bootnode ID on TCP port 30333: [source, shell] cargo run --release \-- \ diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index b5b630653667b..67e6a009c9b4c 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -2056,9 +2056,9 @@ mod tests { #[test] fn code_hash_returns_proper_values() { let code_bob = MockLoader::insert(Call, |ctx, _| { - // ALICE is not a contract and hence she does not have a code_hash + // ALICE is not a contract and hence they do not have a code_hash assert!(ctx.ext.code_hash(&ALICE).is_none()); - // BOB is a contract and hence he has a code_hash + // BOB is a contract and hence it has a code_hash assert!(ctx.ext.code_hash(&BOB).is_some()); exec_success() }); diff --git a/frame/elections-phragmen/src/benchmarking.rs b/frame/elections-phragmen/src/benchmarking.rs index 06ac8d7c60162..53157deaa961b 100644 --- a/frame/elections-phragmen/src/benchmarking.rs +++ b/frame/elections-phragmen/src/benchmarking.rs @@ -32,7 +32,7 @@ const BALANCE_FACTOR: u32 = 250; /// grab new account with infinite balance. fn endowed_account(name: &'static str, index: u32) -> T::AccountId { let account: T::AccountId = account(name, index, 0); - // Fund each account with at-least his stake but still a sane amount as to not mess up + // Fund each account with at-least their stake but still a sane amount as to not mess up // the vote calculation. let amount = default_stake::(T::MaxVoters::get()) * BalanceOf::::from(BALANCE_FACTOR); let _ = T::Currency::make_free_balance_be(&account, amount); diff --git a/frame/nfts/src/features/transfer.rs b/frame/nfts/src/features/transfer.rs index 7d6ae3553a361..3a34f0b8c9fe9 100644 --- a/frame/nfts/src/features/transfer.rs +++ b/frame/nfts/src/features/transfer.rs @@ -64,7 +64,7 @@ impl, I: 'static> Pallet { details.owner = dest; // The approved accounts have to be reset to None, because otherwise pre-approve attack - // would be possible, where the owner can approve his second account before making the + // would be possible, where the owner can approve their second account before making the // transaction and then claiming the item back. details.approvals.clear(); diff --git a/frame/nomination-pools/src/migration.rs b/frame/nomination-pools/src/migration.rs index b73141c95f72c..9d1ad5a275163 100644 --- a/frame/nomination-pools/src/migration.rs +++ b/frame/nomination-pools/src/migration.rs @@ -63,7 +63,7 @@ pub mod v1 { /// Trivial migration which makes the roles of each pool optional. /// - /// Note: The depositor is not optional since he can never change. + /// Note: The depositor is not optional since it can never change. pub struct MigrateToV1(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV1 { fn on_runtime_upgrade() -> Weight { diff --git a/frame/nomination-pools/test-staking/src/lib.rs b/frame/nomination-pools/test-staking/src/lib.rs index 00e0e40ce33b0..933e42578d1a6 100644 --- a/frame/nomination-pools/test-staking/src/lib.rs +++ b/frame/nomination-pools/test-staking/src/lib.rs @@ -531,7 +531,7 @@ fn pool_slash_proportional() { #[test] fn pool_slash_non_proportional_only_bonded_pool() { - // A typical example where a pool member unbonds in era 99, and he can get away with a slash + // A typical example where a pool member unbonds in era 99, and they can get away with a slash // that happened in era 100, as long as the pool has enough active bond to cover the slash. If // everything else in the slashing/staking system works, this should always be the case. // Nonetheless, `ledger.slash` has been written such that it will slash greedily from any chunk diff --git a/frame/root-offences/src/tests.rs b/frame/root-offences/src/tests.rs index a8b7d0a6d6aca..2dd78fe37f00f 100644 --- a/frame/root-offences/src/tests.rs +++ b/frame/root-offences/src/tests.rs @@ -44,7 +44,7 @@ fn create_offence_works_given_root_origin() { // the slash should be applied right away. assert_eq!(Balances::free_balance(11), 500); - // the other validator should keep his balance, because we only created + // the other validator should keep their balance, because we only created // an offences for the first validator. assert_eq!(Balances::free_balance(21), 1000); }) @@ -68,7 +68,7 @@ fn create_offence_wont_slash_non_active_validators() { // so 31 didn't get slashed. assert_eq!(Balances::free_balance(31), 500); - // but 11 is an active validator so he got slashed. + // but 11 is an active validator so it got slashed. assert_eq!(Balances::free_balance(11), 800); }) } diff --git a/frame/staking/src/tests.rs b/frame/staking/src/tests.rs index acd41895287c5..9635717d4cf5d 100644 --- a/frame/staking/src/tests.rs +++ b/frame/staking/src/tests.rs @@ -1901,7 +1901,7 @@ fn wrong_vote_is_moot() { #[test] fn bond_with_no_staked_value() { // Behavior when someone bonds with no staked value. - // Particularly when she votes and the candidate is elected. + // Particularly when they votes and the candidate is elected. ExtBuilder::default() .validator_count(3) .existential_deposit(5) diff --git a/frame/uniques/src/functions.rs b/frame/uniques/src/functions.rs index 03dba16eaa12b..4b97303af54b8 100644 --- a/frame/uniques/src/functions.rs +++ b/frame/uniques/src/functions.rs @@ -50,7 +50,7 @@ impl, I: 'static> Pallet { details.owner = dest; // The approved account has to be reset to None, because otherwise pre-approve attack would - // be possible, where the owner can approve his second account before making the transaction + // be possible, where the owner can approve their second account before making the transaction // and then claiming the item back. details.approved = None; From db4aa2ae36a9d4be2517f72ed23044376c4e4c9a Mon Sep 17 00:00:00 2001 From: DanHenton Date: Thu, 26 Jan 2023 14:34:32 +1300 Subject: [PATCH 2/3] cargo fmt --- client/beefy/src/tests.rs | 3 ++- frame/uniques/src/functions.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/beefy/src/tests.rs b/client/beefy/src/tests.rs index ec04a42eec170..2642035ba5dd5 100644 --- a/client/beefy/src/tests.rs +++ b/client/beefy/src/tests.rs @@ -926,7 +926,8 @@ async fn on_demand_beefy_justification_sync() { ) .await; - // Spawn Dave, they are now way behind voting and can only catch up through on-demand justif sync. + // Spawn Dave, they are now way behind voting and can only catch up through on-demand justif + // sync. tokio::spawn(dave_task); // give Dave a chance to spawn and init. run_for(Duration::from_millis(400), &net).await; diff --git a/frame/uniques/src/functions.rs b/frame/uniques/src/functions.rs index 4b97303af54b8..f73e5c479de67 100644 --- a/frame/uniques/src/functions.rs +++ b/frame/uniques/src/functions.rs @@ -50,8 +50,8 @@ impl, I: 'static> Pallet { details.owner = dest; // The approved account has to be reset to None, because otherwise pre-approve attack would - // be possible, where the owner can approve their second account before making the transaction - // and then claiming the item back. + // be possible, where the owner can approve their second account before making the + // transaction and then claiming the item back. details.approved = None; Item::::insert(&collection, &item, &details); From ef87d92415a8a70de4e6e2a0e7861c2a097d363c Mon Sep 17 00:00:00 2001 From: DanHenton Date: Fri, 27 Jan 2023 10:52:13 +1300 Subject: [PATCH 3/3] fix the use of "it" with "they" when dealing about an opperations identity --- frame/nomination-pools/src/migration.rs | 2 +- frame/root-offences/src/tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/nomination-pools/src/migration.rs b/frame/nomination-pools/src/migration.rs index 9d1ad5a275163..4a9b6ca0fe117 100644 --- a/frame/nomination-pools/src/migration.rs +++ b/frame/nomination-pools/src/migration.rs @@ -63,7 +63,7 @@ pub mod v1 { /// Trivial migration which makes the roles of each pool optional. /// - /// Note: The depositor is not optional since it can never change. + /// Note: The depositor is not optional since they can never change. pub struct MigrateToV1(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV1 { fn on_runtime_upgrade() -> Weight { diff --git a/frame/root-offences/src/tests.rs b/frame/root-offences/src/tests.rs index 2dd78fe37f00f..b0df4fcee5314 100644 --- a/frame/root-offences/src/tests.rs +++ b/frame/root-offences/src/tests.rs @@ -68,7 +68,7 @@ fn create_offence_wont_slash_non_active_validators() { // so 31 didn't get slashed. assert_eq!(Balances::free_balance(31), 500); - // but 11 is an active validator so it got slashed. + // but 11 is an active validator so they got slashed. assert_eq!(Balances::free_balance(11), 800); }) }