• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / catalyst-libs / 21003583286

14 Jan 2026 05:27PM UTC coverage: 70.193% (+0.4%) from 69.765%
21003583286

Pull #781

github

web-flow
Merge 5ca23108d into bfceceaed
Pull Request #781: chore(rust/signed-doc): `builder` module, providing corresponding builders for every document type

713 of 771 new or added lines in 45 files covered. (92.48%)

2 existing lines in 1 file now uncovered.

16536 of 23558 relevant lines covered (70.19%)

2311.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.94
/rust/signed_doc/src/builder/proposal_comment.rs
1
use crate::{
2
    CatalystSignedDocument, ContentEncoding, ContentType,
3
    builder::{Builder, ed25519::Ed25519SigningKey},
4
    catalyst_id::CatalystId,
5
    doc_types,
6
    uuid::UuidV7,
7
};
8

9
pub fn proposal_comment_doc(
4✔
10
    content: &serde_json::Value,
4✔
11
    linked: &CatalystSignedDocument,
4✔
12
    template: &CatalystSignedDocument,
4✔
13
    parameters: &CatalystSignedDocument,
4✔
14
    sk: &Ed25519SigningKey,
4✔
15
    kid: CatalystId,
4✔
16
    id: Option<UuidV7>,
4✔
17
) -> anyhow::Result<CatalystSignedDocument> {
4✔
18
    let (id, ver) = id.map_or_else(
4✔
19
        || {
4✔
20
            let id = UuidV7::new();
4✔
21
            (id, id)
4✔
22
        },
4✔
NEW
23
        |v| (v, UuidV7::new()),
×
24
    );
25
    let linked_ref = linked.doc_ref()?;
4✔
26
    let template_ref = template.doc_ref()?;
4✔
27
    let parameters_ref = parameters.doc_ref()?;
4✔
28

29
    Builder::new()
4✔
30
        .with_json_metadata(serde_json::json!({
4✔
31
            "content-type": ContentType::Json,
4✔
32
            "content-encoding": ContentEncoding::Brotli,
4✔
33
            "type": doc_types::PROPOSAL_COMMENT.clone(),
4✔
34
            "id": id,
4✔
35
            "ver": ver,
4✔
36
            "ref": [linked_ref],
4✔
37
            "template": [template_ref],
4✔
38
            "parameters": [parameters_ref]
4✔
NEW
39
        }))?
×
40
        .with_json_content(content)?
4✔
41
        .add_signature(|m| sk.sign(&m), kid)?
4✔
42
        .build()
4✔
43
}
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc