Kill the light client, CHTs and change tries. (#10080)

* Remove light client, change tries and CHTs

* Update tests

* fmt

* Restore changes_root

* Fixed benches

* Cargo fmt

* fmt

* fmt
This commit is contained in:
Arkadiy Paronyan
2021-11-12 14:15:01 +01:00
committed by GitHub
parent 112b7dac47
commit 4cbbf0cf43
141 changed files with 532 additions and 17807 deletions
+7 -10
View File
@@ -1223,7 +1223,7 @@ mod private {
pub trait Sealed {}
impl<T: Encode> Sealed for Vec<T> {}
impl<Hash: Encode> Sealed for Digest<Hash> {}
impl Sealed for Digest {}
impl<T, S> Sealed for BoundedVec<T, S> {}
impl<T, S> Sealed for WeakBoundedVec<T, S> {}
impl<K, V, S> Sealed for bounded_btree_map::BoundedBTreeMap<K, V, S> {}
@@ -1263,7 +1263,7 @@ impl<T: Encode> StorageDecodeLength for Vec<T> {}
/// We abuse the fact that SCALE does not put any marker into the encoding, i.e. we only encode the
/// internal vec and we can append to this vec. We have a test that ensures that if the `Digest`
/// format ever changes, we need to remove this here.
impl<Hash: Encode> StorageAppend<DigestItem<Hash>> for Digest<Hash> {}
impl StorageAppend<DigestItem> for Digest {}
/// Marker trait that is implemented for types that support the `storage::append` api with a limit
/// on the number of element.
@@ -1484,8 +1484,8 @@ mod test {
fn digest_storage_append_works_as_expected() {
TestExternalities::default().execute_with(|| {
struct Storage;
impl generator::StorageValue<Digest<u32>> for Storage {
type Query = Digest<u32>;
impl generator::StorageValue<Digest> for Storage {
type Query = Digest;
fn module_prefix() -> &'static [u8] {
b"MyModule"
@@ -1495,23 +1495,20 @@ mod test {
b"Storage"
}
fn from_optional_value_to_query(v: Option<Digest<u32>>) -> Self::Query {
fn from_optional_value_to_query(v: Option<Digest>) -> Self::Query {
v.unwrap()
}
fn from_query_to_optional_value(v: Self::Query) -> Option<Digest<u32>> {
fn from_query_to_optional_value(v: Self::Query) -> Option<Digest> {
Some(v)
}
}
Storage::append(DigestItem::ChangesTrieRoot(1));
Storage::append(DigestItem::Other(Vec::new()));
let value = unhashed::get_raw(&Storage::storage_value_final_key()).unwrap();
let expected = Digest {
logs: vec![DigestItem::ChangesTrieRoot(1), DigestItem::Other(Vec::new())],
};
let expected = Digest { logs: vec![DigestItem::Other(Vec::new())] };
assert_eq!(Digest::decode(&mut &value[..]).unwrap(), expected);
});
}