Improve PublicKey Hash impl efficiency
Instead of SSZ-encoding, we just use the AMCL tobytes method.
This commit is contained in:
parent
5e5cfb782e
commit
7e79a2b3d3
@ -93,7 +93,11 @@ impl PartialEq for PublicKey {
|
||||
|
||||
impl Hash for PublicKey {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
ssz_encode(self).hash(state)
|
||||
// Note: this is not necessarily the consensus-ready hash. Instead, it is designed to be
|
||||
// optimally fast for internal usage.
|
||||
//
|
||||
// To hash for consensus purposes, use the SSZ-encoded bytes.
|
||||
self.0.as_bytes().hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user