11use std:: collections:: HashSet ;
22
3+ use pluto_ssz:: { Hasher , serde_utils:: Hex0x } ;
4+
35use crate :: {
46 eip712sigs:: {
57 EIP712Error , digest_eip712, eip712_creator_config_hash, eip712_enr,
68 get_operator_eip712_type,
79 } ,
8- helpers:: { EthHex , from_0x_hex_str} ,
10+ helpers:: from_0x_hex_str,
911 operator:: { Operator , OperatorV1X1 , OperatorV1X2OrLater } ,
1012 ssz:: { SSZError , hash_definition} ,
11- ssz_hasher:: Hasher ,
1213 version:: { CURRENT_VERSION , DKG_ALGO , versions:: * } ,
1314} ;
1415use chrono:: { DateTime , Timelike , Utc } ;
@@ -771,7 +772,7 @@ pub struct Creator {
771772 /// The Ethereum address of the creator
772773 pub address : String ,
773774 /// The creator's signature over the config hash
774- #[ serde_as( as = "EthHex " ) ]
775+ #[ serde_as( as = "Hex0x " ) ]
775776 pub config_signature : Vec < u8 > ,
776777}
777778
@@ -817,7 +818,7 @@ pub struct DefinitionV1x0or1 {
817818 pub dkg_algorithm : String ,
818819 /// Cluster's 4 byte beacon chain fork version
819820 /// (network/chain identifier).
820- #[ serde_as( as = "EthHex " ) ]
821+ #[ serde_as( as = "Hex0x " ) ]
821822 pub fork_version : Vec < u8 > ,
822823 /// Config hash uniquely identifies a cluster definition excluding operator
823824 /// ENRs and signatures.
@@ -928,15 +929,15 @@ pub struct DefinitionV1x2or3 {
928929 pub dkg_algorithm : String ,
929930 /// Cluster's 4 byte beacon chain fork version
930931 /// (network/chain identifier).
931- #[ serde_as( as = "EthHex " ) ]
932+ #[ serde_as( as = "Hex0x " ) ]
932933 pub fork_version : Vec < u8 > ,
933934 /// Config hash uniquely identifies a cluster definition excluding operator
934935 /// ENRs and signatures.
935- #[ serde_as( as = "EthHex " ) ]
936+ #[ serde_as( as = "Hex0x " ) ]
936937 pub config_hash : Vec < u8 > ,
937938 /// Definition hash uniquely identifies a cluster definition including
938939 /// operator ENRs and signatures.
939- #[ serde_as( as = "EthHex " ) ]
940+ #[ serde_as( as = "Hex0x " ) ]
940941 pub definition_hash : Vec < u8 > ,
941942}
942943
@@ -1042,15 +1043,15 @@ pub struct DefinitionV1x4 {
10421043 pub dkg_algorithm : String ,
10431044 /// Cluster's 4 byte beacon chain fork version
10441045 /// (network/chain identifier).
1045- #[ serde_as( as = "EthHex " ) ]
1046+ #[ serde_as( as = "Hex0x " ) ]
10461047 pub fork_version : Vec < u8 > ,
10471048 /// Config hash uniquely identifies a cluster definition excluding operator
10481049 /// ENRs and signatures.
1049- #[ serde_as( as = "EthHex " ) ]
1050+ #[ serde_as( as = "Hex0x " ) ]
10501051 pub config_hash : Vec < u8 > ,
10511052 /// Definition hash uniquely identifies a cluster definition including
10521053 /// operator ENRs and signatures.
1053- #[ serde_as( as = "EthHex " ) ]
1054+ #[ serde_as( as = "Hex0x " ) ]
10541055 pub definition_hash : Vec < u8 > ,
10551056}
10561057
@@ -1154,15 +1155,15 @@ pub struct DefinitionV1x5to7 {
11541155 pub dkg_algorithm : String ,
11551156 /// Cluster's 4 byte beacon chain fork version
11561157 /// (network/chain identifier).
1157- #[ serde_as( as = "EthHex " ) ]
1158+ #[ serde_as( as = "Hex0x " ) ]
11581159 pub fork_version : Vec < u8 > ,
11591160 /// Config hash uniquely identifies a cluster definition excluding operator
11601161 /// ENRs and signatures.
1161- #[ serde_as( as = "EthHex " ) ]
1162+ #[ serde_as( as = "Hex0x " ) ]
11621163 pub config_hash : Vec < u8 > ,
11631164 /// Definition hash uniquely identifies a cluster definition including
11641165 /// operator ENRs and signatures.
1165- #[ serde_as( as = "EthHex " ) ]
1166+ #[ serde_as( as = "Hex0x " ) ]
11661167 pub definition_hash : Vec < u8 > ,
11671168}
11681169
@@ -1251,19 +1252,19 @@ pub struct DefinitionV1x8 {
12511252 pub dkg_algorithm : String ,
12521253 /// ForkVersion defines the cluster's 4 byte beacon chain fork version
12531254 /// (network/chain identifier).
1254- #[ serde_as( as = "EthHex " ) ]
1255+ #[ serde_as( as = "Hex0x " ) ]
12551256 pub fork_version : Vec < u8 > ,
12561257 /// DepositAmounts specifies partial deposit amounts that sum up to at least
12571258 /// 32ETH.
12581259 #[ serde_as( as = "DefaultOnNull<Vec<PickFirst<(DisplayFromStr, _)>>>" ) ]
12591260 pub deposit_amounts : Vec < u64 > ,
12601261 /// ConfigHash uniquely identifies a cluster definition excluding operator
12611262 /// ENRs and signatures.
1262- #[ serde_as( as = "EthHex " ) ]
1263+ #[ serde_as( as = "Hex0x " ) ]
12631264 pub config_hash : Vec < u8 > ,
12641265 /// DefinitionHash uniquely identifies a cluster definition including
12651266 /// operator ENRs and signatures.
1266- #[ serde_as( as = "EthHex " ) ]
1267+ #[ serde_as( as = "Hex0x " ) ]
12671268 pub definition_hash : Vec < u8 > ,
12681269}
12691270
@@ -1353,7 +1354,7 @@ pub struct DefinitionV1x9 {
13531354 pub dkg_algorithm : String ,
13541355 /// ForkVersion defines the cluster's 4 byte beacon chain fork version
13551356 /// (network/chain identifier).
1356- #[ serde_as( as = "EthHex " ) ]
1357+ #[ serde_as( as = "Hex0x " ) ]
13571358 pub fork_version : Vec < u8 > ,
13581359 /// DepositAmounts specifies partial deposit amounts that sum up to at least
13591360 /// 32ETH.
@@ -1364,11 +1365,11 @@ pub struct DefinitionV1x9 {
13641365 pub consensus_protocol : String ,
13651366 /// ConfigHash uniquely identifies a cluster definition excluding operator
13661367 /// ENRs and signatures.
1367- #[ serde_as( as = "EthHex " ) ]
1368+ #[ serde_as( as = "Hex0x " ) ]
13681369 pub config_hash : Vec < u8 > ,
13691370 /// DefinitionHash uniquely identifies a cluster definition including
13701371 /// operator ENRs and signatures.
1371- #[ serde_as( as = "EthHex " ) ]
1372+ #[ serde_as( as = "Hex0x " ) ]
13721373 pub definition_hash : Vec < u8 > ,
13731374}
13741375
@@ -1460,7 +1461,7 @@ pub struct DefinitionV1x10 {
14601461 pub dkg_algorithm : String ,
14611462 /// Cluster's 4 byte beacon chain fork version
14621463 /// (network/chain identifier).
1463- #[ serde_as( as = "EthHex " ) ]
1464+ #[ serde_as( as = "Hex0x " ) ]
14641465 pub fork_version : Vec < u8 > ,
14651466 /// Partial deposit amounts that sum up to at least
14661467 /// 32ETH.
@@ -1476,11 +1477,11 @@ pub struct DefinitionV1x10 {
14761477 pub compounding : bool ,
14771478 /// Config hash uniquely identifies a cluster definition excluding operator
14781479 /// ENRs and signatures.
1479- #[ serde_as( as = "EthHex " ) ]
1480+ #[ serde_as( as = "Hex0x " ) ]
14801481 pub config_hash : Vec < u8 > ,
14811482 /// Definition hash uniquely identifies a cluster definition including
14821483 /// operator ENRs and signatures.
1483- #[ serde_as( as = "EthHex " ) ]
1484+ #[ serde_as( as = "Hex0x " ) ]
14841485 pub definition_hash : Vec < u8 > ,
14851486}
14861487
0 commit comments