aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/catchup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/remake/catchup.rs')
-rw-r--r--src/remake/catchup.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/remake/catchup.rs b/src/remake/catchup.rs
index 0be7dfd..e265d0b 100644
--- a/src/remake/catchup.rs
+++ b/src/remake/catchup.rs
@@ -555,6 +555,7 @@ async fn abandon<H: Host>(host: &H, rejoin: Rejoin, reason: String) {
#[cfg(test)]
mod tests {
use super::*;
+ use crate::document::testing::change;
use crate::remake::snapshot::{SnapshotParams, build};
use automerge::{ActorId, ROOT, transaction::Transactable};
use serde_json::{Value as JsonValue, json};
@@ -563,8 +564,7 @@ mod tests {
/// document of the next epoch (snapshot plus one foreign change).
fn scenario(policy: &JsonValue) -> (AutoCommit, AutoCommit, Epoch) {
let mut old = AutoCommit::new().with_actor(ActorId::from(&b"late-node"[..]));
- old.put(ROOT, "base", 1_i64).unwrap();
- old.commit();
+ change(&mut old, |old| old.put(ROOT, "base", 1_i64).unwrap());
let base = old.get_heads();
let snapshot = build(
@@ -584,11 +584,11 @@ mod tests {
let target = snapshot.epoch;
let mut swarm = snapshot.doc.with_actor(ActorId::from(&b"swarm-node"[..]));
- swarm.put(ROOT, "theirs", 1_i64).unwrap();
- swarm.commit();
+ change(&mut swarm, |swarm| {
+ swarm.put(ROOT, "theirs", 1_i64).unwrap()
+ });
- old.put(ROOT, "mine", 1_i64).unwrap();
- old.commit();
+ change(&mut old, |old| old.put(ROOT, "mine", 1_i64).unwrap());
(old, swarm, target)
}