Skip to content

Commit 9748a20

Browse files
fix(rust/cardano-chain-follower): add CIP509 example (#213)
* chore(cardano-chain-follower): add cip509 to example Signed-off-by: bkioshn <[email protected]> * chore(cardano-chain-follower): add dep and fix tag Signed-off-by: bkioshn <[email protected]> * chore(cardano-chain-follower): update dep tag Signed-off-by: bkioshn <[email protected]> * chore(cardano-chain-follower): fix log Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]> Co-authored-by: Stanislav Tkach <[email protected]>
1 parent dc3bc7e commit 9748a20

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

rust/cardano-chain-follower/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test-log = { version = "0.2.16", default-features = false, features = [
6363
"trace",
6464
] }
6565
clap = "4.5.23"
66-
# rbac-registration = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.8" }
66+
rbac-registration = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250217-00" }
6767

6868
# Note, these features are for support of features exposed by dependencies.
6969
[features]

rust/cardano-chain-follower/examples/follow_chains.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use cardano_blockchain_types::{
1010
};
1111
#[cfg(feature = "mimalloc")]
1212
use mimalloc::MiMalloc;
13+
use rbac_registration::cardano::cip509::Cip509;
1314

1415
/// Use Mimalloc for the global allocator.
1516
#[cfg(feature = "mimalloc")]
@@ -457,8 +458,15 @@ fn log_bad_cip36_info(block: &MultiEraBlock, network: Network) {
457458
}
458459

459460
/// Function for logging bad CIP509.
460-
fn log_bad_cip509_info(_block: &MultiEraBlock, _network: Network) {
461-
// TODO - Implement this function.
461+
fn log_bad_cip509_info(block: &MultiEraBlock, network: Network) {
462+
for cip509 in Cip509::from_block(block, &[]) {
463+
if cip509.report().is_problematic() {
464+
info!(
465+
network = network.to_string(),
466+
"CIP509 invalid: {:?}", cip509
467+
);
468+
}
469+
}
462470
}
463471

464472
#[tokio::main]

0 commit comments

Comments
 (0)