@@ -7,11 +7,9 @@ use std::sync::Arc;
77use cardano_blockchain_types:: { MetadatumLabel , TransactionAuxData } ;
88use minicbor:: { Decode , Decoder } ;
99use pallas:: ledger:: traverse:: MultiEraTx ;
10- use rbac_registration:: cardano:: cip509:: { Cip509 as RbacRegCip509 , Cip509Validation , LABEL } ;
10+ use rbac_registration:: cardano:: cip509:: { Cip509 as RbacRegCip509 , Cip509Validation } ;
1111
12- use super :: {
13- DecodedMetadata , DecodedMetadataItem , DecodedMetadataValues , ValidationReport ,
14- } ;
12+ use super :: { DecodedMetadata , DecodedMetadataItem , DecodedMetadataValues , ValidationReport } ;
1513
1614/// CIP509 metadatum.
1715#[ derive( Debug , PartialEq , Clone , Default ) ]
@@ -42,7 +40,7 @@ impl Cip509 {
4240 let cip509 = match RbacRegCip509 :: decode ( & mut decoder, & mut ( ) ) {
4341 Ok ( metadata) => metadata,
4442 Err ( e) => {
45- Cip509 :: default ( ) . validation_failure (
43+ Cip509 :: default ( ) . decoding_failed (
4644 & format ! ( "Failed to decode CIP509 metadata: {e}" ) ,
4745 & mut validation_report,
4846 decoded_metadata,
@@ -56,22 +54,22 @@ impl Cip509 {
5654
5755 // Create a Cip509 struct and insert it into decoded_metadata
5856 decoded_metadata. 0 . insert (
59- LABEL ,
57+ MetadatumLabel :: CIP509_RBAC ,
6058 Arc :: new ( DecodedMetadataItem {
6159 value : DecodedMetadataValues :: Cip509 ( Arc :: new ( Cip509 { cip509, validation } ) ) ,
6260 report : validation_report. clone ( ) ,
6361 } ) ,
6462 ) ;
6563 }
6664
67- /// Handle validation failure .
68- fn validation_failure (
65+ /// Decoding of the CIP509 metadata failed, and can not continue .
66+ fn decoding_failed (
6967 & self , reason : & str , validation_report : & mut ValidationReport ,
7068 decoded_metadata : & DecodedMetadata ,
7169 ) {
7270 validation_report. push ( reason. into ( ) ) ;
7371 decoded_metadata. 0 . insert (
74- LABEL ,
72+ MetadatumLabel :: CIP509_RBAC ,
7573 Arc :: new ( DecodedMetadataItem {
7674 value : DecodedMetadataValues :: Cip509 ( Arc :: new ( self . clone ( ) ) . clone ( ) ) ,
7775 report : validation_report. clone ( ) ,
0 commit comments