diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index 580da80772..b12986e975 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -208,6 +208,8 @@ mod tests { fn set_storage(&mut self, key: Vec, value: Vec) { self.storage.insert(key, value); } + + fn chain_id(&self) -> u64 { 42 } } #[test] diff --git a/substrate/state_machine/src/lib.rs b/substrate/state_machine/src/lib.rs index 3ff3b69469..e94b2b6078 100644 --- a/substrate/state_machine/src/lib.rs +++ b/substrate/state_machine/src/lib.rs @@ -131,7 +131,7 @@ pub trait Externalities { fn set_storage(&mut self, key: Vec, value: Vec); /// Get the identity of the chain. - fn chain_id(&self) -> u64 { 42 } // TODO: remove implementation and fix resulting errors. + fn chain_id(&self) -> u64; /// Get the current set of authorities from storage. fn authorities(&self) -> Result, Self::Error> { @@ -244,6 +244,8 @@ mod tests { fn set_storage(&mut self, key: Vec, value: Vec) { self.storage.insert(key, value); } + + fn chain_id(&self) -> u64 { 42 } } #[test] diff --git a/substrate/wasm-runtime/polkadot/src/support/testing.rs b/substrate/wasm-runtime/polkadot/src/support/testing.rs index d73917eb16..ec7fac6d6d 100644 --- a/substrate/wasm-runtime/polkadot/src/support/testing.rs +++ b/substrate/wasm-runtime/polkadot/src/support/testing.rs @@ -16,4 +16,6 @@ impl Externalities for TestExternalities { fn set_storage(&mut self, key: Vec, value: Vec) { self.storage.insert(key, value); } + + fn chain_id(&self) -> u64 { 42 } } diff --git a/substrate/wasm-runtime/polkadot/src/system.rs b/substrate/wasm-runtime/polkadot/src/system.rs index 88414fa9a1..de8b814bcf 100644 --- a/substrate/wasm-runtime/polkadot/src/system.rs +++ b/substrate/wasm-runtime/polkadot/src/system.rs @@ -96,6 +96,8 @@ mod tests { fn set_storage(&mut self, key: Vec, value: Vec) { self.storage.insert(key, value); } + + fn chain_id(&self) -> u64 { 42 } } macro_rules! map {