File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
rust/rbac-registration/src Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 22//! Doc Reference: <https://github.com/input-output-hk/catalyst-CIPs/tree/x509-envelope-metadata/CIP-XXXX>
33//! CDDL Reference: <https://github.com/input-output-hk/catalyst-CIPs/blob/x509-envelope-metadata/CIP-XXXX/x509-envelope.cddl>
44
5- use std:: { borrow:: Cow , collections:: HashMap } ;
5+ use std:: {
6+ borrow:: Cow ,
7+ collections:: { HashMap , HashSet } ,
8+ } ;
69
710use anyhow:: { anyhow, Context } ;
811use cardano_blockchain_types:: {
@@ -261,7 +264,7 @@ impl Cip509 {
261264
262265 /// Returns a list of role 0 stake addresses.
263266 #[ must_use]
264- pub fn role_0_stake_addresses ( & self ) -> Vec < StakeAddress > {
267+ pub fn role_0_stake_addresses ( & self ) -> HashSet < StakeAddress > {
265268 self . metadata
266269 . as_ref ( )
267270 . map ( |m| m. certificate_uris . stake_addresses ( 0 ) )
Original file line number Diff line number Diff line change 11//! A set of [`Cip0134Uri`].
22
3- use std:: { collections:: HashMap , sync:: Arc } ;
3+ use std:: {
4+ collections:: { HashMap , HashSet } ,
5+ sync:: Arc ,
6+ } ;
47
58use c509_certificate:: {
69 extensions:: { alt_name:: GeneralNamesOrText , extension:: ExtensionValue } ,
@@ -70,8 +73,8 @@ impl Cip0134UriSet {
7073
7174 /// Returns a list of stake addresses by the given index.
7275 #[ must_use]
73- pub fn stake_addresses ( & self , index : usize ) -> Vec < StakeAddress > {
74- let mut result = Vec :: new ( ) ;
76+ pub fn stake_addresses ( & self , index : usize ) -> HashSet < StakeAddress > {
77+ let mut result = HashSet :: new ( ) ;
7578
7679 if let Some ( uris) = self . x_uris ( ) . get ( & index) {
7780 result. extend ( convert_stake_addresses ( uris) ) ;
Original file line number Diff line number Diff line change 22
33mod update_rbac;
44
5- use std:: { collections:: HashMap , sync:: Arc } ;
5+ use std:: {
6+ collections:: { HashMap , HashSet } ,
7+ sync:: Arc ,
8+ } ;
69
710use anyhow:: bail;
811use c509_certificate:: c509:: C509 ;
@@ -208,9 +211,9 @@ impl RegistrationChain {
208211 . and_then ( |rdr| rdr. encryption_key_from_rotation ( rotation) )
209212 }
210213
211- /// Returns a list of role 0 stake addresses.
214+ /// Returns a set of role 0 stake addresses.
212215 #[ must_use]
213- pub fn role_0_stake_addresses ( & self ) -> Vec < StakeAddress > {
216+ pub fn role_0_stake_addresses ( & self ) -> HashSet < StakeAddress > {
214217 self . inner . certificate_uris . stake_addresses ( 0 )
215218 }
216219}
You can’t perform that action at this time.
0 commit comments