Skip to content

Commit 8287bc0

Browse files
Revert UUID changes (temporary)
1 parent c7d1aa1 commit 8287bc0

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

rust/catalyst-types/src/uuid/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ mod uuid_v4;
44
mod uuid_v7;
55

66
use minicbor::data::Tag;
7-
pub use uuid_v4::UuidV4;
8-
pub use uuid_v7::UuidV7;
7+
pub use uuid_v4::UuidV4 as V4;
8+
pub use uuid_v7::UuidV7 as V7;
99

1010
/// Invalid Doc Type UUID
1111
pub const INVALID_UUID: uuid::Uuid = uuid::Uuid::from_bytes([0x00; 16]);
@@ -77,12 +77,12 @@ fn encode_cbor_uuid<W: minicbor::encode::Write>(
7777
#[cfg(test)]
7878
mod tests {
7979

80-
use super::{UuidV4, UuidV7};
80+
use super::{V4, V7};
8181
use crate::uuid::CborContext;
8282

8383
#[test]
8484
fn test_cbor_uuid_v4_roundtrip() {
85-
let uuid: UuidV4 = uuid::Uuid::new_v4().into();
85+
let uuid: V4 = uuid::Uuid::new_v4().into();
8686
let mut bytes = Vec::new();
8787
minicbor::encode_with(uuid, &mut bytes, &mut CborContext::Untagged).unwrap();
8888
let decoded = minicbor::decode_with(bytes.as_slice(), &mut CborContext::Untagged).unwrap();
@@ -91,7 +91,7 @@ mod tests {
9191

9292
#[test]
9393
fn test_cbor_uuid_v7_roundtrip() {
94-
let uuid: UuidV7 = uuid::Uuid::now_v7().into();
94+
let uuid: V7 = uuid::Uuid::now_v7().into();
9595
let mut bytes = Vec::new();
9696
minicbor::encode_with(uuid, &mut bytes, &mut CborContext::Untagged).unwrap();
9797
let decoded = minicbor::decode_with(bytes.as_slice(), &mut CborContext::Untagged).unwrap();
@@ -100,7 +100,7 @@ mod tests {
100100

101101
#[test]
102102
fn test_tagged_cbor_uuid_v4_roundtrip() {
103-
let uuid: UuidV4 = uuid::Uuid::new_v4().into();
103+
let uuid: V4 = uuid::Uuid::new_v4().into();
104104
let mut bytes = Vec::new();
105105
minicbor::encode_with(uuid, &mut bytes, &mut CborContext::Tagged).unwrap();
106106
let decoded = minicbor::decode_with(bytes.as_slice(), &mut CborContext::Tagged).unwrap();
@@ -109,7 +109,7 @@ mod tests {
109109

110110
#[test]
111111
fn test_tagged_cbor_uuid_v7_roundtrip() {
112-
let uuid: UuidV7 = uuid::Uuid::now_v7().into();
112+
let uuid: V7 = uuid::Uuid::now_v7().into();
113113
let mut bytes = Vec::new();
114114
minicbor::encode_with(uuid, &mut bytes, &mut CborContext::Tagged).unwrap();
115115
let decoded = minicbor::decode_with(bytes.as_slice(), &mut CborContext::Tagged).unwrap();
@@ -118,7 +118,7 @@ mod tests {
118118

119119
#[test]
120120
fn test_optional_cbor_uuid_v4_roundtrip() {
121-
let uuid: UuidV4 = uuid::Uuid::new_v4().into();
121+
let uuid: V4 = uuid::Uuid::new_v4().into();
122122

123123
let mut bytes = Vec::new();
124124
minicbor::encode_with(uuid, &mut bytes, &mut CborContext::Untagged).unwrap();
@@ -133,7 +133,7 @@ mod tests {
133133

134134
#[test]
135135
fn test_optional_cbor_uuid_v7_roundtrip() {
136-
let uuid: UuidV7 = uuid::Uuid::now_v7().into();
136+
let uuid: V7 = uuid::Uuid::now_v7().into();
137137

138138
let mut bytes = Vec::new();
139139
minicbor::encode_with(uuid, &mut bytes, &mut CborContext::Untagged).unwrap();

rust/catalyst-types/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fn test_type_usage() {
99
type B = catalyst_types::hashes::Blake2b224Hash;
1010
type C = catalyst_types::hashes::Blake2b256Hash;
1111

12-
type D = catalyst_types::uuid::UuidV4;
13-
type E = catalyst_types::uuid::UuidV7;
12+
type D = catalyst_types::uuid::V4;
13+
type E = catalyst_types::uuid::V7;
1414

1515
type F = catalyst_types::kid_uri::KidUri;
1616

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use cardano_blockchain_types::{MetadatumLabel, MultiEraBlock, TxnIndex};
99
use catalyst_types::{
1010
hashes::{Blake2b256Hash, BLAKE_2B256_SIZE},
1111
problem_report::ProblemReport,
12-
uuid::UuidV4,
12+
uuid::V4,
1313
};
1414
use cbork_utils::decode_helper::{decode_bytes, decode_helper, decode_map_len};
1515
use minicbor::{
@@ -55,7 +55,7 @@ pub struct Cip509 {
5555
/// A registration purpose (`UUIDv4`).
5656
///
5757
/// The purpose is defined by the consuming dApp.
58-
purpose: Option<UuidV4>,
58+
purpose: Option<V4>,
5959
/// Transaction inputs hash.
6060
txn_inputs_hash: Option<TxInputHash>,
6161
/// An optional hash of the previous transaction.
@@ -247,7 +247,7 @@ impl Cip509 {
247247
/// # Errors
248248
///
249249
/// - `Err(ProblemReport)`
250-
pub fn consume(self) -> Result<(UuidV4, Cip509RbacMetadata, PaymentHistory), ProblemReport> {
250+
pub fn consume(self) -> Result<(V4, Cip509RbacMetadata, PaymentHistory), ProblemReport> {
251251
match (
252252
self.purpose,
253253
self.txn_inputs_hash,
@@ -436,7 +436,7 @@ fn payment_history(
436436
/// Decodes purpose.
437437
fn decode_purpose(
438438
d: &mut Decoder, context: &str, report: &ProblemReport,
439-
) -> Result<Option<UuidV4>, ()> {
439+
) -> Result<Option<V4>, ()> {
440440
let bytes = match decode_bytes(d, "Cip509 purpose") {
441441
Ok(v) => v,
442442
Err(e) => {
@@ -455,7 +455,7 @@ fn decode_purpose(
455455
);
456456
return Ok(None);
457457
};
458-
let uuid = UuidV4::from(uuid);
458+
let uuid = V4::from(uuid);
459459
if uuid.is_valid() {
460460
Ok(Some(uuid))
461461
} else {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{collections::HashMap, sync::Arc};
44

55
use anyhow::bail;
66
use c509_certificate::c509::C509;
7-
use catalyst_types::{hashes::Blake2b256Hash, uuid::UuidV4};
7+
use catalyst_types::{hashes::Blake2b256Hash, uuid::V4};
88
use ed25519_dalek::VerifyingKey;
99
use tracing::{error, warn};
1010
use x509_cert::certificate::Certificate as X509Certificate;
@@ -63,7 +63,7 @@ impl RegistrationChain {
6363

6464
/// Get a list of purpose for this registration chain.
6565
#[must_use]
66-
pub fn purpose(&self) -> &[UuidV4] {
66+
pub fn purpose(&self) -> &[V4] {
6767
&self.inner.purpose
6868
}
6969

@@ -110,7 +110,7 @@ struct RegistrationChainInner {
110110
/// The current transaction ID hash (32 bytes)
111111
current_tx_id_hash: Blake2b256Hash,
112112
/// List of purpose for this registration chain
113-
purpose: Vec<UuidV4>,
113+
purpose: Vec<V4>,
114114

115115
// RBAC
116116
/// Map of index in array to point, transaction index, and x509 certificate.

rust/rbac-registration/src/utils/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// cspell: words stake_test1urs8t0ssa3w9wh90ld5tprp3gurxd487rth2qlqk6ernjqcef4ugr
44

55
use cardano_blockchain_types::{MultiEraBlock, Network, Point, Slot, TxnIndex};
6-
use catalyst_types::{hashes::Blake2b256Hash, uuid::UuidV4};
6+
use catalyst_types::{hashes::Blake2b256Hash, uuid::V4};
77
use uuid::Uuid;
88

99
use crate::cardano::cip509::{Cip509, RoleNumber};
@@ -24,7 +24,7 @@ pub struct BlockTestData {
2424
/// Previous hash.
2525
pub prv_hash: Option<Blake2b256Hash>,
2626
/// Purpose.
27-
pub purpose: UuidV4,
27+
pub purpose: V4,
2828
/// Stake address.
2929
pub stake_addr: Option<String>,
3030
}

0 commit comments

Comments
 (0)