diff --git a/CHANGELOG.md b/CHANGELOG.md index 1afe46864b1..1c9207a0cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Add Hash trait to Selector struct ## Version 5.0.0-rc.3 diff --git a/crates/metadata/src/specs.rs b/crates/metadata/src/specs.rs index 1d9599f668b..62ff372b7fe 100644 --- a/crates/metadata/src/specs.rs +++ b/crates/metadata/src/specs.rs @@ -52,7 +52,10 @@ use serde::{ Serialize, }; #[cfg(feature = "std")] -use std::collections::BTreeMap; +use std::{ + collections::BTreeMap, + hash::Hash, +}; /// Describes a contract. #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] @@ -1091,6 +1094,7 @@ where } /// The 4 byte selector to identify constructors and messages +#[cfg_attr(feature = "std", derive(Hash))] #[derive(Debug, Default, PartialEq, Eq, derive_more::From, JsonSchema)] pub struct Selector(#[schemars(with = "String")] [u8; 4]);