• 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.33
/rust/signed_doc/src/builder/proposal.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_doc(
37✔
10
    content: &serde_json::Value,
37✔
11
    template: &CatalystSignedDocument,
37✔
12
    parameters: &CatalystSignedDocument,
37✔
13
    sk: &Ed25519SigningKey,
37✔
14
    kid: CatalystId,
37✔
15
    id: Option<UuidV7>,
37✔
16
) -> anyhow::Result<CatalystSignedDocument> {
37✔
17
    let (id, ver) = id.map_or_else(
37✔
18
        || {
37✔
19
            let id = UuidV7::new();
37✔
20
            (id, id)
37✔
21
        },
37✔
NEW
22
        |v| (v, UuidV7::new()),
×
23
    );
24
    let template_ref = template.doc_ref()?;
37✔
25
    let parameters_ref = parameters.doc_ref()?;
37✔
26

27
    Builder::new()
37✔
28
        .with_json_metadata(serde_json::json!({
37✔
29
            "content-type": ContentType::Json,
37✔
30
            "content-encoding": ContentEncoding::Brotli,
37✔
31
            "type": doc_types::PROPOSAL.clone(),
37✔
32
            "id": id,
37✔
33
            "ver": ver,
37✔
34
            "template": [template_ref],
37✔
35
            "parameters": [parameters_ref]
37✔
NEW
36
        }))?
×
37
        .with_json_content(content)?
37✔
38
        .add_signature(|m| sk.sign(&m), kid)?
37✔
39
        .build()
37✔
40
}
37✔
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