@@ -2,13 +2,12 @@ use super::{
2
2
trusted_setup_points:: { G1_POINTS , G2_POINTS } ,
3
3
KzgSettings ,
4
4
} ;
5
- use core:: hash:: { Hash , Hasher } ;
6
5
use once_cell:: race:: OnceBox ;
7
6
use std:: { boxed:: Box , sync:: Arc } ;
8
7
9
8
/// KZG Settings that allow us to specify a custom trusted setup.
10
9
/// or use hardcoded default settings.
11
- #[ derive( Debug , Clone , Default , Eq ) ]
10
+ #[ derive( Debug , Clone , Default , PartialEq , Eq , Hash ) ]
12
11
pub enum EnvKzgSettings {
13
12
/// Default mainnet trusted setup
14
13
#[ default]
@@ -17,27 +16,6 @@ pub enum EnvKzgSettings {
17
16
Custom ( Arc < c_kzg:: KzgSettings > ) ,
18
17
}
19
18
20
- // Implement PartialEq and Hash manually because `c_kzg::KzgSettings` does not implement them
21
- impl PartialEq for EnvKzgSettings {
22
- fn eq ( & self , other : & Self ) -> bool {
23
- match ( self , other) {
24
- ( Self :: Default , Self :: Default ) => true ,
25
- ( Self :: Custom ( a) , Self :: Custom ( b) ) => Arc :: ptr_eq ( a, b) ,
26
- _ => false ,
27
- }
28
- }
29
- }
30
-
31
- impl Hash for EnvKzgSettings {
32
- fn hash < H : Hasher > ( & self , state : & mut H ) {
33
- core:: mem:: discriminant ( self ) . hash ( state) ;
34
- match self {
35
- Self :: Default => { }
36
- Self :: Custom ( settings) => Arc :: as_ptr ( settings) . hash ( state) ,
37
- }
38
- }
39
- }
40
-
41
19
impl EnvKzgSettings {
42
20
/// Return set KZG settings.
43
21
///
0 commit comments