Remove BlockNumber <-> u64 conversions from light-client related code (#2666)

* Remove As usage from CHT

* Remove As usage from CHT (continue)

* Restrict BN <-> int conversions in CT

* more BN <-> u64 conversions removed

* upd spec_version

* Apply suggestions from code review

Co-Authored-By: Gavin Wood <github@gavwood.com>

* Apply suggestions from code review

Co-Authored-By: Gavin Wood <github@gavwood.com>

* more grumbles

* fix last grumbles + compilation

* too long lines

* too long lines
This commit is contained in:
Svyatoslav Nikolsky
2019-05-28 16:07:16 +03:00
committed by Gavin Wood
parent 25b88f1a1f
commit 549d9e1da1
41 changed files with 1087 additions and 654 deletions
+3 -3
View File
@@ -158,10 +158,10 @@ impl StorageApi for () {
}).expect("child_storage_root cannot be called outside of an Externalities-provided environment.")
}
fn storage_changes_root(parent_hash: [u8; 32], parent_num: u64) -> Option<[u8; 32]> {
fn storage_changes_root(parent_hash: [u8; 32]) -> Option<[u8; 32]> {
ext::with(|ext|
ext.storage_changes_root(parent_hash.into(), parent_num).map(Into::into)
).unwrap_or(None)
ext.storage_changes_root(parent_hash.into()).map(|h| h.map(|h| h.into()))
).unwrap_or(Ok(None)).expect("Invalid parent hash passed to storage_changes_root")
}
fn enumerated_trie_root<H>(input: &[&[u8]]) -> H::Out