Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit e4783a6

Browse files
bkchrXanewok
authored andcommitted
Backport #7381
1 parent a200cdb commit e4783a6

File tree

52 files changed

+110
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+110
-104
lines changed

Cargo.lock

+24-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sc-cli"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
description = "Substrate CLI interface."
66
edition = "2018"

client/cli/src/commands/export_blocks_cmd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl ExportBlocksCmd {
8585
info!("DB path: {}", path.display());
8686
}
8787

88-
let from = self.from.as_ref().and_then(|f| f.parse().ok()).unwrap_or(1);
88+
let from = self.from.as_ref().and_then(|f| f.parse().ok()).unwrap_or(1u32);
8989
let to = self.to.as_ref().and_then(|t| t.parse().ok());
9090

9191
let binary = self.binary;

client/finality-grandpa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sc-finality-grandpa"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
66
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

client/finality-grandpa/src/voting_rule.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<Block, B> Default for VotingRulesBuilder<Block, B> where
241241
{
242242
fn default() -> Self {
243243
VotingRulesBuilder::new()
244-
.add(BeforeBestBlockBy(2.into()))
244+
.add(BeforeBestBlockBy(2u32.into()))
245245
.add(ThreeQuartersOfTheUnfinalizedChain)
246246
}
247247
}

client/informant/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sc-informant"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
description = "Substrate informant."
66
edition = "2018"

client/informant/src/display.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fn speed<B: BlockT>(
168168
} else {
169169
// If the number of blocks can't be converted to a regular integer, then we need a more
170170
// algebraic approach and we stay within the realm of integers.
171-
let one_thousand = NumberFor::<B>::from(1_000);
171+
let one_thousand = NumberFor::<B>::from(1_000u32);
172172
let elapsed = NumberFor::<B>::from(
173173
<u32 as TryFrom<_>>::try_from(elapsed_ms).unwrap_or(u32::max_value())
174174
);

client/network/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
description = "Substrate network protocol"
33
name = "sc-network"
4-
version = "0.8.0"
4+
version = "0.8.1"
55
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
66
authors = ["Parity Technologies <admin@parity.io>"]
77
edition = "2018"

client/network/src/light_client_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ mod tests {
14291429
_: ChangesProof<B::Header>
14301430
) -> Result<Vec<(NumberFor<B>, u32)>, ClientError> {
14311431
match self.ok {
1432-
true => Ok(vec![(100.into(), 2)]),
1432+
true => Ok(vec![(100u32.into(), 2)]),
14331433
false => Err(ClientError::Backend("Test error".into())),
14341434
}
14351435
}

client/service/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sc-service"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
66
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

client/service/src/chain_ops/export_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ where
8787
// Reached end of the chain.
8888
None => return Poll::Ready(Ok(())),
8989
}
90-
if (block % 10000.into()).is_zero() {
90+
if (block % 10000u32.into()).is_zero() {
9191
info!("#{}", block);
9292
}
9393
if block == last {

client/service/src/chain_ops/import_blocks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<B: BlockT> Speedometer<B> {
200200
/// Creates a fresh Speedometer.
201201
fn new() -> Self {
202202
Self {
203-
best_number: NumberFor::<B>::from(0),
203+
best_number: NumberFor::<B>::from(0u32),
204204
last_number: None,
205205
last_update: Instant::now(),
206206
}
@@ -232,7 +232,7 @@ impl<B: BlockT> Speedometer<B> {
232232
} else {
233233
// If the number of blocks can't be converted to a regular integer, then we need a more
234234
// algebraic approach and we stay within the realm of integers.
235-
let one_thousand = NumberFor::<B>::from(1_000);
235+
let one_thousand = NumberFor::<B>::from(1_000u32);
236236
let elapsed = NumberFor::<B>::from(
237237
<u32 as TryFrom<_>>::try_from(elapsed_ms).unwrap_or(u32::max_value())
238238
);

client/service/src/client/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use sp_runtime::{
3838
generic::{BlockId, SignedBlock, DigestItem},
3939
traits::{
4040
Block as BlockT, Header as HeaderT, Zero, NumberFor,
41-
HashFor, SaturatedConversion, One, DigestFor,
41+
HashFor, SaturatedConversion, One, DigestFor, UniqueSaturatedInto,
4242
},
4343
};
4444
use sp_state_machine::{
@@ -1139,7 +1139,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
11391139
let mut ancestor = load_header(ancestor_hash)?;
11401140
let mut uncles = Vec::new();
11411141

1142-
for _generation in 0..max_generation.saturated_into() {
1142+
for _generation in 0u32..UniqueSaturatedInto::<u32>::unique_saturated_into(max_generation) {
11431143
let children = self.backend.blockchain().children(ancestor_hash)?;
11441144
uncles.extend(children.into_iter().filter(|h| h != &current_hash));
11451145
current_hash = ancestor_hash;

client/service/src/metrics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ impl MetricsService {
316316
);
317317

318318
if let Some(metrics) = self.metrics.as_ref() {
319-
let best_seen_block = net_status
319+
let best_seen_block: Option<u64> = net_status
320320
.best_seen_block
321-
.map(|num: NumberFor<T>| num.unique_saturated_into() as u64);
321+
.map(|num: NumberFor<T>| UniqueSaturatedInto::<u64>::unique_saturated_into(num));
322322

323323
if let Some(best_seen_block) = best_seen_block {
324324
metrics.block_height.with_label_values(&["sync_target"]).set(best_seen_block);

client/transaction-pool/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sc-transaction-pool"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
66
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

client/transaction-pool/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ impl<PoolApi, Block> MaintainedTransactionPool for BasicPool<PoolApi, Block>
569569
let next_action = self.revalidation_strategy.lock().next(
570570
block_number,
571571
Some(std::time::Duration::from_secs(60)),
572-
Some(20.into()),
572+
Some(20u32.into()),
573573
);
574574
let revalidation_strategy = self.revalidation_strategy.clone();
575575
let revalidation_queue = self.revalidation_queue.clone();

frame/aura/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pallet-aura"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
66
license = "Apache-2.0"

frame/aura/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub trait Trait: pallet_timestamp::Trait {
7474
decl_storage! {
7575
trait Store for Module<T: Trait> as Aura {
7676
/// The last timestamp.
77-
LastTimestamp get(fn last) build(|_| 0.into()): T::Moment;
77+
LastTimestamp get(fn last): T::Moment;
7878

7979
/// The current authorities
8080
pub Authorities get(fn authorities): Vec<T::AuthorityId>;
@@ -196,7 +196,7 @@ impl<T: Trait> Module<T> {
196196
pub fn slot_duration() -> T::Moment {
197197
// we double the minimum block-period so each author can always propose within
198198
// the majority of its slot.
199-
<T as pallet_timestamp::Trait>::MinimumPeriod::get().saturating_mul(2.into())
199+
<T as pallet_timestamp::Trait>::MinimumPeriod::get().saturating_mul(2u32.into())
200200
}
201201

202202
fn on_timestamp_set(now: T::Moment, slot_duration: T::Moment) {

0 commit comments

Comments
 (0)