refactor: define trait HashOutput for some Hash associate type (#14220)

* define trait `HashOutput`

* improve

* improve

* Update primitives/runtime/src/traits.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* remove `Block::Hash: Ord`

* fmt

* add `MaybeFromStr`

* cleanup

* fix

* remove useless `HashOutput`

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
yjh
2023-06-08 10:02:13 +08:00
committed by GitHub
parent c31c6a1a73
commit ddb46a8aa0
19 changed files with 85 additions and 146 deletions
-1
View File
@@ -113,7 +113,6 @@ impl BlockNumberOrHash {
/// Parse the inner value as `BlockId`.
pub fn parse<B: BlockT>(&self) -> Result<BlockId<B>, String>
where
B::Hash: FromStr,
<B::Hash as FromStr>::Err: std::fmt::Debug,
NumberFor<B>: FromStr,
<NumberFor<B> as FromStr>::Err: std::fmt::Debug,