22//! <https://input-output-hk.github.io/catalyst-libs/architecture/08_concepts/signed_doc/meta/>
33
44use anyhow:: Context ;
5- use catalyst_signed_doc_spec:: { DocSpec , DocSpecs } ;
5+ use catalyst_signed_doc_spec:: { cddl_definitions :: CddlDefitions , DocSpec , DocSpecs } ;
66use futures:: FutureExt ;
77
88use crate :: {
@@ -118,6 +118,7 @@ impl Rules {
118118
119119 /// Creating a `Rules` instance from the provided specs.
120120 fn new (
121+ cddl_defs : & CddlDefitions ,
121122 all_docs_specs : & DocSpecs ,
122123 doc_spec : & DocSpec ,
123124 ) -> anyhow:: Result < Self > {
@@ -133,7 +134,7 @@ impl Rules {
133134 reply : ReplyRule :: new ( all_docs_specs, & doc_spec. metadata . reply ) ?,
134135 section : SectionRule :: NotSpecified ,
135136 collaborators : CollaboratorsRule :: new ( & doc_spec. metadata . collaborators ) ,
136- content : ContentRule :: new ( & doc_spec. payload ) ?,
137+ content : ContentRule :: new ( cddl_defs , & doc_spec. payload ) ?,
137138 kid : SignatureKidRule :: new ( & doc_spec. signers . roles ) ?,
138139 signature : SignatureRule ,
139140 ownership : DocumentOwnershipRule :: new ( & doc_spec. signers . update , doc_spec) ?,
@@ -157,7 +158,7 @@ impl Rules {
157158 continue ;
158159 }
159160
160- let rules = Self :: new ( & spec. docs , doc_spec)
161+ let rules = Self :: new ( & spec. cddl_definitions , & spec . docs , doc_spec)
161162 . context ( format ! ( "Fail to initializing document '{doc_name}'" ) ) ?;
162163 let doc_type = doc_spec. doc_type . parse ( ) ?;
163164
0 commit comments