diff --git a/substrate/primitives/externalities/src/lib.rs b/substrate/primitives/externalities/src/lib.rs index 411ec97a6b82..41ebf8edd150 100644 --- a/substrate/primitives/externalities/src/lib.rs +++ b/substrate/primitives/externalities/src/lib.rs @@ -309,6 +309,11 @@ pub trait Externalities: ExtensionStore { /// /// Get all the keys that have been read or written to during the benchmark. fn get_read_and_written_keys(&self) -> Vec<(Vec, u32, u32, bool)>; + + /// Access to `OverlayChanges` for `gear-tasks`. + fn gear_overlayed_changes(&self) -> Option> { + None + } } /// Extension for the [`Externalities`] trait. diff --git a/substrate/primitives/state-machine/src/ext.rs b/substrate/primitives/state-machine/src/ext.rs index 11df46f2a4a3..b3cee955a1fa 100644 --- a/substrate/primitives/state-machine/src/ext.rs +++ b/substrate/primitives/state-machine/src/ext.rs @@ -159,7 +159,7 @@ where impl<'a, H, B> Externalities for Ext<'a, H, B> where - H: Hasher, + H: Hasher + 'static, H::Out: Ord + 'static + codec::Codec, B: Backend, { @@ -651,6 +651,10 @@ where fn get_read_and_written_keys(&self) -> Vec<(Vec, u32, u32, bool)> { self.backend.get_read_and_written_keys() } + + fn gear_overlayed_changes(&self) -> Option> { + Some(Box::new(self.overlay.clone())) + } } impl<'a, H, B> Ext<'a, H, B> diff --git a/substrate/primitives/state-machine/src/lib.rs b/substrate/primitives/state-machine/src/lib.rs index 94c89382cf60..8c34154c70c1 100644 --- a/substrate/primitives/state-machine/src/lib.rs +++ b/substrate/primitives/state-machine/src/lib.rs @@ -224,7 +224,7 @@ mod execution { impl<'a, B, H, Exec> StateMachine<'a, B, H, Exec> where - H: Hasher, + H: Hasher + 'static, H::Out: Ord + 'static + codec::Codec, Exec: CodeExecutor + Clone + 'static, B: Backend, @@ -331,7 +331,7 @@ mod execution { ) -> Result<(Vec, StorageProof), Box> where B: AsTrieBackend, - H: Hasher, + H: Hasher + 'static, H::Out: Ord + 'static + codec::Codec, Exec: CodeExecutor + Clone + 'static, { @@ -367,7 +367,7 @@ mod execution { ) -> Result<(Vec, StorageProof), Box> where S: trie_backend_essence::TrieBackendStorage, - H: Hasher, + H: Hasher + 'static, H::Out: Ord + 'static + codec::Codec, Exec: CodeExecutor + 'static + Clone, { @@ -429,7 +429,7 @@ mod execution { runtime_code: &RuntimeCode, ) -> Result, Box> where - H: Hasher, + H: Hasher + 'static, H::Out: Ord + 'static + codec::Codec, Exec: CodeExecutor + Clone + 'static, {