From 1899ef76b4ed720825265194f601c20b38c0102e Mon Sep 17 00:00:00 2001 From: TW Date: Mon, 9 Sep 2024 16:22:49 +0800 Subject: [PATCH] add support for drep reg with anchor --- .../sidan-csl-rs/src/core/utils/certificates.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/sidan-csl-rs/src/core/utils/certificates.rs b/packages/sidan-csl-rs/src/core/utils/certificates.rs index 36817ef..248dfa0 100644 --- a/packages/sidan-csl-rs/src/core/utils/certificates.rs +++ b/packages/sidan-csl-rs/src/core/utils/certificates.rs @@ -308,9 +308,18 @@ fn to_drep_registration_cert( )); }; - Ok(csl::Certificate::new_drep_registration( - &csl::DRepRegistration::new(&drep_credential, &to_bignum(drep_registration.coin)), - )) + match drep_registration.anchor { + Some(anchor) => Ok(csl::Certificate::new_drep_registration( + &csl::DRepRegistration::new_with_anchor( + &drep_credential, + &to_bignum(drep_registration.coin), + &to_csl_anchor(&anchor)?, + ), + )), + None => Ok(csl::Certificate::new_drep_registration( + &csl::DRepRegistration::new(&drep_credential, &to_bignum(drep_registration.coin)), + )), + } } fn to_drep_deregistration_cert(