diff options
Diffstat (limited to 'src/remake/records.rs')
| -rw-r--r-- | src/remake/records.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/remake/records.rs b/src/remake/records.rs index 40b563a..fecae4c 100644 --- a/src/remake/records.rs +++ b/src/remake/records.rs @@ -38,7 +38,7 @@ use crate::clock::UnixMillis; use crate::document::meta::{self, REMAKES, VOTES}; use crate::document::replica::Epoch; use crate::document::store::{self, StoreError}; -use crate::document::{ChangeHash, Document}; +use crate::document::{ChangeHash, Document, Transactable}; /// One day, for retention defaults. const DAY_MS: u64 = 24 * 60 * 60 * 1000; @@ -446,7 +446,7 @@ pub(crate) fn load_register(doc: &Document) -> Register { } fn write_part<T: Serialize>( - doc: &mut Document, + doc: &mut impl Transactable, id: &str, part: &str, value: &T, @@ -456,7 +456,7 @@ fn write_part<T: Serialize>( } pub(crate) fn write_proposal( - doc: &mut Document, + doc: &mut impl Transactable, id: &str, proposal: &Proposal, ) -> Result<(), StoreError> { @@ -464,7 +464,7 @@ pub(crate) fn write_proposal( } pub(crate) fn write_decision( - doc: &mut Document, + doc: &mut impl Transactable, id: &str, decision: &Decision, ) -> Result<(), StoreError> { @@ -472,7 +472,7 @@ pub(crate) fn write_decision( } pub(crate) fn write_abort_request( - doc: &mut Document, + doc: &mut impl Transactable, id: &str, request: &AbortRequest, ) -> Result<(), StoreError> { @@ -480,7 +480,11 @@ pub(crate) fn write_abort_request( } /// Writes `voter`'s entry in the votes register (replacing its earlier one). -pub(crate) fn write_vote(doc: &mut Document, voter: &str, vote: &Vote) -> Result<(), StoreError> { +pub(crate) fn write_vote( + doc: &mut impl Transactable, + voter: &str, + vote: &Vote, +) -> Result<(), StoreError> { let json = serde_json::to_value(vote).map_err(anyhow::Error::from)?; store::write_path(doc, ®ister_path(voter), &json) } |
