Skip to content

Commit c949a12

Browse files
committed
wip
1 parent 6d52775 commit c949a12

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

rust/rbac-registration/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ thiserror = "2.0.11"
3434

3535
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "c509-certificate-v0.0.3" }
3636
cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cbork-utils-v0.0.2" }
37-
cardano-blockchain-types = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-blockchain-types/v0.0.8" }
37+
cardano-blockchain-types = { version = "0.0.9", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "feat/cip-134-uri-hash" }
3838
catalyst-types = { version = "0.0.10", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types/v0.0.10" }

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ impl Cip0134UriSet {
179179
},
180180
X509DerCert::X509Cert(_) => {
181181
if let Some(uris) = metadata.certificate_uris.x_uris().get(&index) {
182-
taken_uris.remove(&uris);
182+
uris.iter().for_each(|v| {
183+
taken_uris.remove(v);
184+
});
183185
x_uris.insert(index, uris.clone());
184186
}
185187
},
@@ -199,7 +201,9 @@ impl Cip0134UriSet {
199201
},
200202
C509Cert::C509Certificate(_) => {
201203
if let Some(uris) = metadata.certificate_uris.c_uris().get(&index) {
202-
taken_uris.remove(&uris);
204+
uris.iter().for_each(|v| {
205+
taken_uris.remove(v);
206+
});
203207
c_uris.insert(index, uris.clone());
204208
}
205209
},
@@ -224,10 +228,16 @@ impl Cip0134UriSet {
224228
) -> Self {
225229
let taken_uri_set = metadata.certificate_uris.values().collect::<HashSet<_>>();
226230
let current_uris_set = self.values().collect::<HashSet<_>>();
227-
let taken_uris = current_uris_set.intersection(&taken_uri_set);
231+
let latest_taken_uris = current_uris_set.intersection(&taken_uri_set);
232+
let latest_taken_uris = latest_taken_uris.cloned().cloned().collect::<Vec<_>>();
228233

229-
let Cip0134UriSetInner { x_uris, c_uris, .. } = Arc::unwrap_or_clone(self.0);
230-
let taken_uris = taken_uris.cloned().cloned().collect();
234+
let Cip0134UriSetInner {
235+
x_uris,
236+
c_uris,
237+
mut taken_uris,
238+
} = Arc::unwrap_or_clone(self.0);
239+
240+
taken_uris.extend(latest_taken_uris);
231241

232242
Self(Arc::new(Cip0134UriSetInner {
233243
x_uris,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl RegistrationChain {
347347
/// Returns all stake addresses associated to this chain.
348348
#[must_use]
349349
pub fn stake_addresses(&self) -> HashSet<StakeAddress> {
350-
self.inner.certificate_uris.stake_addresses();
350+
self.inner.certificate_uris.stake_addresses()
351351
}
352352

353353
/// Returns the latest know applied registration's `PointTxnIdx`.
@@ -548,7 +548,7 @@ impl RegistrationChainInner {
548548
return None;
549549
}
550550

551-
return new_inner.update_cause_another_chain(cip509);
551+
return Some(new_inner.update_cause_another_chain(cip509));
552552
} else {
553553
cip509
554554
.report()

0 commit comments

Comments
 (0)