pub struct AmendmentDraft {
pub amendment: Amendment,
pub texts: AmendmentTexts,
}Expand description
An Amendment and the texts it commits to: what a writer appends,
the first as the entry’s data and the second beside it
Fields§
§amendment: Amendment§texts: AmendmentTextsImplementations§
Source§impl AmendmentDraft
impl AmendmentDraft
Sourcepub fn new(
target: GovernanceLogId,
target_entry_hash: Sha256Hex,
kind: AmendmentKind,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
) -> Result<Self, AmendmentError>
pub fn new( target: GovernanceLogId, target_entry_hash: Sha256Hex, kind: AmendmentKind, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, ) -> Result<Self, AmendmentError>
Sourcepub fn redaction(
amendment_id: &GovernanceLogId,
target: GovernanceLogId,
target_entry_hash: Sha256Hex,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
fields: Vec<String>,
data: &Value,
blind: Blind,
revisions: &[&Revision],
) -> Result<(Self, Value), RedactError>
pub fn redaction( amendment_id: &GovernanceLogId, target: GovernanceLogId, target_entry_hash: Sha256Hex, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, fields: Vec<String>, data: &Value, blind: Blind, revisions: &[&Revision], ) -> Result<(Self, Value), RedactError>
A redaction of fields from the target’s data, with the redacted
data it commits to.
amendment_id is the id this amendment will be appended under: the
marker left behind names it, so the redaction says who ordered it.
Append both together or neither — the returned data is what the
target’s row must hold for verify_chain to accept it. blind
is the target’s new Blind: random, so a
rehearsal’s resulting_data_hash is not the real one’s.
revisions are the target’s, in chain order. They are rebased over
the redacted data, which must still take every patch, and a value
they removed as a duplicate of a redacted one is redacted from the
stored original too: fields is extended with it, or the erased
text would still be readable as first signed.
Sourcepub fn revision(
target: GovernanceLogId,
target_type: GovernanceLogEntryType,
target_entry_hash: Sha256Hex,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
latest: &Value,
edit: impl Into<Edit>,
) -> Result<(Self, Value), ReviseError>
pub fn revision( target: GovernanceLogId, target_type: GovernanceLogEntryType, target_entry_hash: Sha256Hex, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, latest: &Value, edit: impl Into<Edit>, ) -> Result<(Self, Value), ReviseError>
A revision of the target by edit (a patch, or
Revision::remove_duplicates), applied to its latest version
(see latest); returns the next version it commits to.
Nothing is written to the target. A patch that adds content (add
or replace) to a target without a Blind adds one too, so the
public resulting_data_hash cannot confirm a guess at text a later
redaction removes; copy and move add nothing that was not
already covered by the entry’s own hash. A patch may not touch an
existing blind.
The draft with the governance entry that authorizes it
Sourcepub fn with_rationale(self, rationale: impl Into<CommittedText>) -> Self
pub fn with_rationale(self, rationale: impl Into<CommittedText>) -> Self
The draft with its rationale