Skip to content

Commit

Permalink
fix: role data
Browse files Browse the repository at this point in the history
  • Loading branch information
bkioshn committed Aug 29, 2024
1 parent f80bbd6 commit dd5be53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//! Doc Reference: <https://github.com/input-output-hk/catalyst-CIPs/tree/x509-role-registration-metadata/CIP-XXXX>
//! CDDL Reference: <https://github.com/input-output-hk/catalyst-CIPs/blob/x509-role-registration-metadata/CIP-XXXX/x509-roles.cddl>
mod certs;
mod pub_key;
mod role_data;
pub mod certs;
pub mod pub_key;
pub mod role_data;

use std::collections::HashMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use strum::FromRepr;
use super::Cip509RbacMetadataInt;
use crate::metadata::cip509::{
decode_any,
decode_helper::{decode_array_len, decode_bytes, decode_map_len, decode_u64, decode_u8},
decode_helper::{
decode_array_len, decode_bytes, decode_i64, decode_map_len, decode_u64, decode_u8,
},
};

/// Struct of role data.
Expand All @@ -21,7 +23,7 @@ pub struct RoleData {
/// Optional role encryption key.
pub role_encryption_key: Option<KeyReference>,
/// Optional payment key.
pub payment_key: Option<u64>,
pub payment_key: Option<i64>,
/// Optional role extended data keys.
/// Empty map if no role extended data keys.
pub role_extended_data_keys: HashMap<u8, Vec<u8>>,
Expand Down Expand Up @@ -65,7 +67,7 @@ impl Decode<'_, ()> for RoleData {
role_data.role_encryption_key = Some(KeyReference::decode(d, ctx)?);
},
RoleDataInt::PaymentKey => {
role_data.payment_key = Some(decode_u64(d, "PaymentKey in RoleData")?);
role_data.payment_key = Some(decode_i64(d, "PaymentKey in RoleData")?);
},
}
} else {
Expand Down

0 comments on commit dd5be53

Please sign in to comment.