mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-04 23:13:07 +00:00
make messagehash to derive from Hash
This commit is contained in:
parent
3b0015dda5
commit
566fae9dac
@ -4,11 +4,11 @@ use serde::{Deserialize, Deserializer, Serialize};
|
||||
use std::convert::TryInto;
|
||||
use std::fmt;
|
||||
use std::fmt::Write;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::hash::Hash;
|
||||
use std::str::FromStr;
|
||||
|
||||
/// Waku message hash, hex encoded sha256 digest of the message
|
||||
#[derive(Debug, Serialize, PartialEq, Eq, Clone)]
|
||||
#[derive(Debug, Serialize, PartialEq, Eq, Clone, Hash)]
|
||||
pub struct MessageHash([u8; 32]);
|
||||
|
||||
impl MessageHash {
|
||||
@ -20,13 +20,6 @@ impl MessageHash {
|
||||
}
|
||||
}
|
||||
|
||||
impl Hash for MessageHash {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
// Use the inner array to contribute to the hash
|
||||
self.0.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for MessageHash {
|
||||
type Err = String;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user