Skip to content

Commit 8c23786

Browse files
committed
fix(rust/signed_doc): wip fixes to examples
1 parent 68b1989 commit 8c23786

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

rust/signed_doc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ workspace = true
1212

1313
[dependencies]
1414
cardano-blockchain-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.11" }
15-
catalyst-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250111-00" }
15+
catalyst-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250112-00" }
1616
anyhow = "1.0.95"
1717
serde = { version = "1.0.217", features = ["derive"] }
1818
serde_json = "1.0.134"

rust/signed_doc/examples/mk_signed_doc.rs

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn decode_cbor_uuid(val: &coset::cbor::Value) -> anyhow::Result<uuid::Uuid> {
8181
Ok(uuid)
8282
}
8383

84-
fn encode_cbor_document_ref(doc_ref: &DocumentRef) -> coset::cbor::Value {
84+
fn _encode_cbor_document_ref(doc_ref: &DocumentRef) -> coset::cbor::Value {
8585
match doc_ref {
8686
DocumentRef::Latest { id } => encode_cbor_uuid(&id.uuid()),
8787
DocumentRef::WithVer { id, ver } => {
@@ -227,30 +227,32 @@ fn build_empty_cose_doc(doc_bytes: Vec<u8>, meta: &Metadata) -> coset::CoseSign
227227
coset::Label::Text("ver".to_string()),
228228
encode_cbor_uuid(&meta.doc_ver()),
229229
));
230-
if let Some(r#ref) = &meta.doc_ref() {
231-
protected_header.rest.push((
232-
coset::Label::Text("ref".to_string()),
233-
encode_cbor_document_ref(r#ref),
234-
));
235-
}
236-
if let Some(template) = &meta.doc_template() {
237-
protected_header.rest.push((
238-
coset::Label::Text("template".to_string()),
239-
encode_cbor_document_ref(template),
240-
));
241-
}
242-
if let Some(reply) = &meta.doc_reply() {
243-
protected_header.rest.push((
244-
coset::Label::Text("reply".to_string()),
245-
encode_cbor_document_ref(reply),
246-
));
247-
}
248-
if let Some(section) = &meta.doc_section() {
249-
protected_header.rest.push((
250-
coset::Label::Text("section".to_string()),
251-
coset::cbor::Value::Text(section.clone()),
252-
));
253-
}
230+
// WIP: encode additional metadata fields
231+
//
232+
// if let Some(r#ref) = &meta.doc_ref() {
233+
// protected_header.rest.push((
234+
// coset::Label::Text("ref".to_string()),
235+
// encode_cbor_document_ref(r#ref),
236+
// ));
237+
//}
238+
// if let Some(template) = &meta.doc_template() {
239+
// protected_header.rest.push((
240+
// coset::Label::Text("template".to_string()),
241+
// encode_cbor_document_ref(template),
242+
// ));
243+
//}
244+
// if let Some(reply) = &meta.doc_reply() {
245+
// protected_header.rest.push((
246+
// coset::Label::Text("reply".to_string()),
247+
// encode_cbor_document_ref(reply),
248+
// ));
249+
//}
250+
// if let Some(section) = &meta.doc_section() {
251+
// protected_header.rest.push((
252+
// coset::Label::Text("section".to_string()),
253+
// coset::cbor::Value::Text(section.clone()),
254+
// ));
255+
//}
254256

255257
coset::CoseSignBuilder::new()
256258
.protected(protected_header)

0 commit comments

Comments
 (0)