Skip to content

Commit e4e5a50

Browse files
authored
wip (#658)
1 parent b9d316e commit e4e5a50

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

rust/rbac-registration/src/cardano/cip509/cip509.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl Cip509 {
310310

311311
/// Returns URIs contained in both x509 and c509 certificates of `Cip509` metadata.
312312
#[must_use]
313-
pub(crate) fn certificate_uris(&self) -> Option<&Cip0134UriSet> {
313+
pub fn certificate_uris(&self) -> Option<&Cip0134UriSet> {
314314
self.metadata.as_ref().map(|m| &m.certificate_uris)
315315
}
316316

rust/rbac-registration/src/cardano/cip509/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub use types::{
99
CertKeyHash, CertOrPk, KeyLocalRef, LocalRefInt, Payment, PaymentHistory, PointData,
1010
PointTxnIdx, RoleData, RoleDataRecord, TxInputHash, ValidationSignature,
1111
};
12-
pub(crate) use utils::{Cip0134UriSet, extract_key};
12+
pub use utils::{Cip0134UriSet, extract_key};
1313

1414
#[allow(clippy::module_inception)]
1515
mod cip509;

rust/rbac-registration/src/cardano/cip509/utils/cip134_uri_set.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type UrisMap = HashMap<usize, Box<[Cip0134Uri]>>;
3030
/// This structure uses [`Arc`] internally, so it is cheap to clone.
3131
#[derive(Debug, Clone, Eq, PartialEq)]
3232
#[allow(clippy::module_name_repetitions)]
33-
pub(crate) struct Cip0134UriSet(Arc<Cip0134UriSetInner>);
33+
pub struct Cip0134UriSet(Arc<Cip0134UriSetInner>);
3434

3535
/// Internal `Cip0134UriSet` data.
3636
#[derive(Debug, Clone, Eq, PartialEq)]
@@ -74,16 +74,16 @@ impl Cip0134UriSet {
7474
}
7575

7676
/// Returns an iterator over of `Cip0134Uri`.
77-
pub(crate) fn values(&self) -> impl Iterator<Item = &Cip0134Uri> {
77+
pub fn values(&self) -> impl Iterator<Item = &Cip0134Uri> {
7878
self.x_uris()
7979
.values()
8080
.chain(self.c_uris().values())
8181
.flat_map(|uris| uris.iter())
8282
}
8383

8484
/// Returns `true` if both x509 and c509 certificate maps are empty.
85-
#[cfg(test)]
86-
pub(crate) fn is_empty(&self) -> bool {
85+
#[must_use]
86+
pub fn is_empty(&self) -> bool {
8787
self.x_uris().is_empty() && self.c_uris().is_empty()
8888
}
8989

@@ -124,7 +124,7 @@ impl Cip0134UriSet {
124124

125125
/// Returns a set of all active (without taken) stake addresses.
126126
#[must_use]
127-
pub(crate) fn stake_addresses(&self) -> HashSet<StakeAddress> {
127+
pub fn stake_addresses(&self) -> HashSet<StakeAddress> {
128128
self.values()
129129
.filter_map(|uri| {
130130
match uri.address() {

rust/rbac-registration/src/cardano/cip509/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
33
pub mod cip19;
44
pub mod extract_key;
5-
pub(crate) use cip134_uri_set::Cip0134UriSet;
5+
pub use cip134_uri_set::Cip0134UriSet;
66

77
mod cip134_uri_set;

rust/rbac-registration/src/registration/cardano/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ impl RegistrationChain {
320320
.and_then(|rdr| rdr.encryption_key_from_rotation(rotation))
321321
}
322322

323+
/// Returns most recent URIs contained from both x509 and c509 certificates.
324+
#[must_use]
325+
pub fn certificate_uris(&self) -> &Cip0134UriSet {
326+
&self.inner.certificate_uris
327+
}
328+
323329
/// Returns all stake addresses associated to this chain.
324330
#[must_use]
325331
pub fn stake_addresses(&self) -> HashSet<StakeAddress> {

0 commit comments

Comments
 (0)