Skip to content

Commit 5ae828a

Browse files
committed
wip
1 parent 74fcede commit 5ae828a

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

rust/signed_doc/src/builder.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,14 @@ pub(crate) mod tests {
246246
kid: super::CatalystId,
247247
) -> anyhow::Result<Self> {
248248
let metadata = WithCborBytes::new(self.metadata, &mut ())?;
249-
let content = WithCborBytes::new(self.content, &mut ())?;
250-
self.signatures
251-
.push(super::build_signature(sign_fn, kid, &metadata, &content)?);
249+
self.signatures.push(super::build_signature(
250+
sign_fn,
251+
kid,
252+
&metadata,
253+
&self.content,
254+
)?);
252255
self.metadata = metadata.inner();
253-
self.content = content.inner();
256+
self.content = self.content;
254257
Ok(self)
255258
}
256259

rust/signed_doc/src/validator/rules/content.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ mod tests {
131131
;
132132
"expected not nil content"
133133
)]
134+
#[test_case(
135+
|| {
136+
Builder::new()
137+
.with_content(vec![])
138+
.build()
139+
}
140+
=> true
141+
;
142+
"expected not nil empty content"
143+
)]
134144
#[test_case(
135145
|| {
136146
Builder::new()
@@ -166,6 +176,16 @@ mod tests {
166176
;
167177
"non expected not nil content"
168178
)]
179+
#[test_case(
180+
|| {
181+
Builder::new()
182+
.with_content(vec![])
183+
.build()
184+
}
185+
=> false
186+
;
187+
"non expected not nil empty"
188+
)]
169189
#[tokio::test]
170190
async fn template_rule_nil_test(doc_gen: impl FnOnce() -> CatalystSignedDocument) -> bool {
171191
let rule = ContentRule::Nil;

0 commit comments

Comments
 (0)