Make Substrate compile with latest nightly (#7381)

* Try to get it compiling

* One more

* Make stable happy

* Make stable even more happy ;)

* Update shell.nix
This commit is contained in:
Bastian Köcher
2020-10-23 21:08:04 +02:00
committed by GitHub
parent 4366fe366a
commit 5808f467c5
29 changed files with 63 additions and 57 deletions
@@ -69,7 +69,7 @@ const RANDOM_MATERIAL_LEN: u32 = 81;
fn block_number_to_index<T: Trait>(block_number: T::BlockNumber) -> usize {
// on_initialize is called on the first block after genesis
let index = (block_number - 1.into()) % RANDOM_MATERIAL_LEN.into();
let index = (block_number - 1u32.into()) % RANDOM_MATERIAL_LEN.into();
index.try_into().ok().expect("Something % 81 is always smaller than usize; qed")
}