Light friendly storage tracking: changes trie + extending over ranges (#628)

* changes_trie

* changs_trie: continue

* changes_trie: adding tests

* fixed TODO

* removed obsolete ExtrinsicChanges

* encodable ChangesTrieConfiguration

* removed polkadot fle

* fixed grumbles

* ext_storage_changes_root returns u32

* moved changes trie root to digest

* removed commented code

* read storage values from native code

* fixed grumbles

* fixed grumbles

* missing comma
This commit is contained in:
Svyatoslav Nikolsky
2018-09-18 10:14:41 +03:00
committed by Gav Wood
parent 24479cd7f5
commit 7fa337afbc
64 changed files with 3130 additions and 788 deletions
+12 -2
View File
@@ -105,6 +105,7 @@ impl system::Trait for Runtime {
type AccountId = AccountId;
type Header = generic::Header<BlockNumber, BlakeTwo256, Log>;
type Event = Event;
type Log = Log;
}
impl balances::Trait for Runtime {
@@ -177,18 +178,27 @@ impl contract::Trait for Runtime {
}
impl DigestItem for Log {
type Hash = Hash;
type AuthorityId = SessionKey;
fn as_authorities_change(&self) -> Option<&[Self::AuthorityId]> {
match self.0 {
InternalLog::consensus(ref item) => item.as_authorities_change(),
_ => None,
}
}
fn as_changes_trie_root(&self) -> Option<&Self::Hash> {
match self.0 {
InternalLog::system(ref item) => item.as_changes_trie_root(),
_ => None,
}
}
}
construct_runtime!(
pub enum Runtime with Log(InternalLog: DigestItem<SessionKey>) {
System: system,
pub enum Runtime with Log(InternalLog: DigestItem<Hash, SessionKey>) {
System: system::{default, Log(ChangesTrieRoot)},
Consensus: consensus::{Module, Call, Storage, Config, Log(AuthoritiesChange)},
Balances: balances,
Timestamp: timestamp::{Module, Call, Storage, Config},