Skip to content

Commit

Permalink
remove serde derive for BlockId (paritytech#13457)
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhmelody authored and ukint-vs committed Apr 10, 2023
1 parent 06cda1e commit 26dffe1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions primitives/runtime/src/generic/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block: BlockT> {
/// Identify by block header hash.
Hash(Block::Hash),
Expand All @@ -45,12 +42,12 @@ pub enum BlockId<Block: BlockT> {

impl<Block: BlockT> BlockId<Block> {
/// 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<Block>) -> Self {
pub const fn number(number: NumberFor<Block>) -> Self {
BlockId::Number(number)
}

Expand Down

0 comments on commit 26dffe1

Please sign in to comment.