@@ -71,15 +71,15 @@ impl RegistrationChain {
7171 ) ;
7272 }
7373
74- check_signing_pk ( cat_id, cip509, state) . await ?;
74+ check_signing_public_key ( cat_id, cip509, state) . await ?;
7575 }
7676
7777 if cip509. report ( ) . is_problematic ( ) {
7878 return Ok ( None ) ;
7979 }
8080
8181 state
82- . take_stake_address_from_chains ( cip509. stake_addresses ( ) . into_iter ( ) )
82+ . take_stake_address_from_chains ( cip509. stake_addresses ( ) )
8383 . await ?;
8484
8585 Ok ( Some ( new_chain) )
@@ -133,7 +133,7 @@ impl RegistrationChain {
133133 }
134134 }
135135
136- check_signing_pk ( self . catalyst_id ( ) , cip509, state) . await ?;
136+ check_signing_public_key ( self . catalyst_id ( ) , cip509, state) . await ?;
137137
138138 if cip509. report ( ) . is_problematic ( ) {
139139 Ok ( None )
@@ -151,7 +151,7 @@ impl RegistrationChain {
151151 & self ,
152152 cip509 : & Cip509 ,
153153 ) -> Option < Self > {
154- let latest_signing_pk = self . get_latest_signing_pk_for_role ( RoleId :: Role0 ) ;
154+ let latest_signing_pk = self . get_latest_signing_public_key_for_role ( RoleId :: Role0 ) ;
155155 let new_inner = if let Some ( ( signing_pk, _) ) = latest_signing_pk {
156156 self . inner . update ( cip509, signing_pk) ?
157157 } else {
@@ -247,11 +247,11 @@ impl RegistrationChain {
247247 /// Get the latest signing public key for a role.
248248 /// Returns the public key and the rotation,`None` if not found.
249249 #[ must_use]
250- pub fn get_latest_signing_pk_for_role (
250+ pub fn get_latest_signing_public_key_for_role (
251251 & self ,
252252 role : RoleId ,
253253 ) -> Option < ( VerifyingKey , KeyRotation ) > {
254- self . inner . get_latest_signing_pk_for_role ( role)
254+ self . inner . get_latest_signing_public_key_for_role ( role)
255255 }
256256
257257 /// Get the latest encryption public key for a role.
@@ -261,7 +261,7 @@ impl RegistrationChain {
261261 & self ,
262262 role : RoleId ,
263263 ) -> Option < ( VerifyingKey , KeyRotation ) > {
264- self . inner . get_latest_encryption_pk_for_role ( role)
264+ self . inner . get_latest_encryption_public_key_for_role ( role)
265265 }
266266
267267 /// Get signing public key for a role with given rotation.
@@ -274,7 +274,7 @@ impl RegistrationChain {
274274 ) -> Option < VerifyingKey > {
275275 self . inner . role_data_record . get ( role) . and_then ( |rdr| {
276276 rdr. signing_key_from_rotation ( rotation)
277- . and_then ( CertOrPk :: extract_pk )
277+ . and_then ( CertOrPk :: extract_public_key )
278278 } )
279279 }
280280
@@ -288,7 +288,7 @@ impl RegistrationChain {
288288 ) -> Option < VerifyingKey > {
289289 self . inner . role_data_record . get ( role) . and_then ( |rdr| {
290290 rdr. encryption_key_from_rotation ( rotation)
291- . and_then ( CertOrPk :: extract_pk )
291+ . and_then ( CertOrPk :: extract_public_key )
292292 } )
293293 }
294294
@@ -398,7 +398,7 @@ impl RegistrationChainInner {
398398 return None ;
399399 } ;
400400
401- let Some ( registration) = cip509. metadata ( ) . cloned ( ) else {
401+ let Some ( registration) = cip509. metadata ( ) else {
402402 cip509. report ( ) . missing_field ( "metadata" , context) ;
403403 return None ;
404404 } ;
@@ -408,7 +408,7 @@ impl RegistrationChainInner {
408408 let mut role_data_record = HashMap :: new ( ) ;
409409 let point_tx_idx = cip509. origin ( ) . clone ( ) ;
410410 update_role_data (
411- & registration,
411+ registration,
412412 & mut role_data_history,
413413 & mut role_data_record,
414414 & point_tx_idx,
@@ -423,7 +423,7 @@ impl RegistrationChainInner {
423423 let Some ( signing_pk) = role0_data
424424 . signing_keys ( )
425425 . last ( )
426- . and_then ( |key| key. data ( ) . extract_pk ( ) )
426+ . and_then ( |key| key. data ( ) . extract_public_key ( ) )
427427 else {
428428 cip509
429429 . report ( )
@@ -643,31 +643,31 @@ impl RegistrationChainInner {
643643 /// Get the latest signing public key for a role.
644644 /// Returns the public key and the rotation,`None` if not found.
645645 #[ must_use]
646- pub fn get_latest_signing_pk_for_role (
646+ pub fn get_latest_signing_public_key_for_role (
647647 & self ,
648648 role : RoleId ,
649649 ) -> Option < ( VerifyingKey , KeyRotation ) > {
650650 self . role_data_record . get ( & role) . and_then ( |rdr| {
651651 rdr. signing_keys ( ) . last ( ) . and_then ( |key| {
652652 let rotation = KeyRotation :: from_latest_rotation ( rdr. signing_keys ( ) ) ;
653653
654- key. data ( ) . extract_pk ( ) . map ( |pk| ( pk, rotation) )
654+ key. data ( ) . extract_public_key ( ) . map ( |pk| ( pk, rotation) )
655655 } )
656656 } )
657657 }
658658
659659 /// Get the latest encryption public key for a role.
660660 /// Returns the public key and the rotation, `None` if not found.
661661 #[ must_use]
662- pub fn get_latest_encryption_pk_for_role (
662+ pub fn get_latest_encryption_public_key_for_role (
663663 & self ,
664664 role : RoleId ,
665665 ) -> Option < ( VerifyingKey , KeyRotation ) > {
666666 self . role_data_record . get ( & role) . and_then ( |rdr| {
667667 rdr. encryption_keys ( ) . last ( ) . and_then ( |key| {
668668 let rotation = KeyRotation :: from_latest_rotation ( rdr. encryption_keys ( ) ) ;
669669
670- key. data ( ) . extract_pk ( ) . map ( |pk| ( pk, rotation) )
670+ key. data ( ) . extract_public_key ( ) . map ( |pk| ( pk, rotation) )
671671 } )
672672 } )
673673 }
@@ -731,7 +731,7 @@ fn check_validation_signature(
731731
732732/// Checks that a new registration doesn't contain a signing key that was used by any
733733/// other chain.
734- async fn check_signing_pk < State > (
734+ async fn check_signing_public_key < State > (
735735 cat_id : & CatalystId ,
736736 cip509 : & Cip509 ,
737737 state : & State ,
@@ -740,8 +740,10 @@ where
740740 State : RbacChainsState ,
741741{
742742 for role in cip509. all_roles ( ) {
743- if let Some ( key) = cip509. signing_pk_for_role ( role)
744- && let Some ( previous) = state. chain_catalyst_id_from_signing_pk ( & key) . await ?
743+ if let Some ( key) = cip509. signing_public_key_for_role ( role)
744+ && let Some ( previous) = state
745+ . chain_catalyst_id_from_signing_public_key ( & key)
746+ . await ?
745747 && & previous != cat_id
746748 {
747749 cip509. report ( ) . functional_validation (
@@ -835,7 +837,7 @@ mod test {
835837 assert_eq ! ( role_0_data. extended_data( ) . len( ) , 2 ) ;
836838
837839 let ( _k, r) = update
838- . get_latest_signing_pk_for_role ( RoleId :: Role0 )
840+ . get_latest_signing_public_key_for_role ( RoleId :: Role0 )
839841 . unwrap ( ) ;
840842 assert_eq ! ( r, KeyRotation :: from( 1 ) ) ;
841843 assert ! (
0 commit comments