Skip to main content

dpp_rules/lineage/
input.rs

1//! Borrowing views a caller supplies to the lineage consent rule.
2//!
3//! Primitive views rather than domain types, so core and the Wasm plugins each
4//! adapt their own representation — typed structs on one side, JSON fields on
5//! the other — without this crate depending on either.
6
7/// What a caller found out about the transfer it correlated to one edge.
8#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub struct TransferEvidence<'a> {
10    /// The transfer's reason, in wire form (`"repurposing"`, …).
11    ///
12    /// Compared as a string against the edge's operation because the two
13    /// vocabularies are defined in a crate this one must not depend on. They are
14    /// pinned byte-identical on the core side.
15    pub reason: &'a str,
16    /// The DID of the operator taking responsibility on.
17    pub incoming_operator_did: &'a str,
18    /// Whether the **outgoing** operator's authorisation is present.
19    ///
20    /// This is the predecessor's own signature, and the load-bearing half — see
21    /// [`super::consent`] for why the other half is not evidence of consent.
22    pub outgoing_authorised: bool,
23    /// Whether the handover was accepted and completed, rather than left
24    /// pending, rejected or cancelled.
25    pub accepted: bool,
26}
27
28/// One derivation edge, with whatever transfer the caller correlated to it.
29#[derive(Debug, Clone, Copy, PartialEq, Eq)]
30pub struct DerivationEdge<'a> {
31    /// The Art. 77(7) operation this edge claims, in wire form.
32    pub operation: &'a str,
33    /// The transfer the caller matched to this predecessor. `None` means the
34    /// caller looked and found nothing.
35    pub transfer: Option<TransferEvidence<'a>>,
36}