diff --git a/primitives/runtime/src/generic/block.rs b/primitives/runtime/src/generic/block.rs index 85d0b7ca1fd2d..1df747a16c839 100644 --- a/primitives/runtime/src/generic/block.rs +++ b/primitives/runtime/src/generic/block.rs @@ -33,9 +33,6 @@ use sp_std::prelude::*; /// Something to identify a block. #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] -#[cfg_attr(feature = "std", derive(Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[cfg_attr(feature = "std", serde(deny_unknown_fields))] pub enum BlockId { /// Identify by block header hash. Hash(Block::Hash), @@ -45,12 +42,12 @@ pub enum BlockId { impl BlockId { /// Create a block ID from a hash. - pub fn hash(hash: Block::Hash) -> Self { + pub const fn hash(hash: Block::Hash) -> Self { BlockId::Hash(hash) } /// Create a block ID from a number. - pub fn number(number: NumberFor) -> Self { + pub const fn number(number: NumberFor) -> Self { BlockId::Number(number) }