Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/rbac-registration/src/cardano/cip509/cip509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl Cip509 {

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

Expand Down
2 changes: 1 addition & 1 deletion rust/rbac-registration/src/cardano/cip509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub use types::{
CertKeyHash, CertOrPk, KeyLocalRef, LocalRefInt, Payment, PaymentHistory, PointData,
PointTxnIdx, RoleData, RoleDataRecord, TxInputHash, ValidationSignature,
};
pub(crate) use utils::{Cip0134UriSet, extract_key};
pub use utils::{Cip0134UriSet, extract_key};

#[allow(clippy::module_inception)]
mod cip509;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type UrisMap = HashMap<usize, Box<[Cip0134Uri]>>;
/// This structure uses [`Arc`] internally, so it is cheap to clone.
#[derive(Debug, Clone, Eq, PartialEq)]
#[allow(clippy::module_name_repetitions)]
pub(crate) struct Cip0134UriSet(Arc<Cip0134UriSetInner>);
pub struct Cip0134UriSet(Arc<Cip0134UriSetInner>);

/// Internal `Cip0134UriSet` data.
#[derive(Debug, Clone, Eq, PartialEq)]
Expand Down Expand Up @@ -74,16 +74,16 @@ impl Cip0134UriSet {
}

/// Returns an iterator over of `Cip0134Uri`.
pub(crate) fn values(&self) -> impl Iterator<Item = &Cip0134Uri> {
pub fn values(&self) -> impl Iterator<Item = &Cip0134Uri> {
self.x_uris()
.values()
.chain(self.c_uris().values())
.flat_map(|uris| uris.iter())
}

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

Expand Down Expand Up @@ -124,7 +124,7 @@ impl Cip0134UriSet {

/// Returns a set of all active (without taken) stake addresses.
#[must_use]
pub(crate) fn stake_addresses(&self) -> HashSet<StakeAddress> {
pub fn stake_addresses(&self) -> HashSet<StakeAddress> {
self.values()
.filter_map(|uri| {
match uri.address() {
Expand Down
2 changes: 1 addition & 1 deletion rust/rbac-registration/src/cardano/cip509/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

pub mod cip19;
pub mod extract_key;
pub(crate) use cip134_uri_set::Cip0134UriSet;
pub use cip134_uri_set::Cip0134UriSet;

mod cip134_uri_set;
6 changes: 6 additions & 0 deletions rust/rbac-registration/src/registration/cardano/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ impl RegistrationChain {
.and_then(|rdr| rdr.encryption_key_from_rotation(rotation))
}

/// Returns most recent URIs contained from both x509 and c509 certificates.
#[must_use]
pub fn certificate_uris(&self) -> &Cip0134UriSet {
&self.inner.certificate_uris
}

/// Returns all stake addresses associated to this chain.
#[must_use]
pub fn stake_addresses(&self) -> HashSet<StakeAddress> {
Expand Down
Loading