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/cardano-chain-follower/src/metadata/cip509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// cspell: words pkix

pub mod rbac;
pub mod utils;
pub mod x509_chunks;

mod decode_helper;
mod utils;

use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ impl Decode<'_, ()> for KeyReference {
#[derive(Debug, PartialEq, Clone)]
pub struct KeyLocalRef {
/// Local reference.
local_ref: LocalRefInt,
pub local_ref: LocalRefInt,
/// Key offset.
key_offset: u64,
pub key_offset: u64,
}

/// Enum of local reference with its associated unsigned integer value.
#[derive(FromRepr, Debug, PartialEq, Clone)]
#[repr(u8)]
enum LocalRefInt {
pub enum LocalRefInt {
/// x509 certificates.
X509Certs = Cip509RbacMetadataInt::X509Certs as u8, // 10
/// c509 certificates.
Expand Down
3 changes: 2 additions & 1 deletion rust/cardano-chain-follower/src/metadata/cip509/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use crate::witness::TxWitness;
/// Example input: `web+cardano://addr/<cip-19 address string>`
/// <https://github.com/cardano-foundation/CIPs/tree/6bae5165dde5d803778efa5e93bd408f3317ca03/CPS-0016>
/// URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]
pub(crate) fn extract_cip19_hash(uri: &str, prefix: Option<&str>) -> Option<Vec<u8>> {
#[must_use]
pub fn extract_cip19_hash(uri: &str, prefix: Option<&str>) -> Option<Vec<u8>> {
// Regex pattern to match the expected URI format
let r = Regex::new("^.+://addr/(.+)$").ok()?;

Expand Down