summaryrefslogtreecommitdiffstats
path: root/src/simtest
diff options
context:
space:
mode:
Diffstat (limited to 'src/simtest')
-rw-r--r--src/simtest/identity.rs10
-rw-r--r--src/simtest/timing.rs16
2 files changed, 13 insertions, 13 deletions
diff --git a/src/simtest/identity.rs b/src/simtest/identity.rs
index ec5d665..b789bda 100644
--- a/src/simtest/identity.rs
+++ b/src/simtest/identity.rs
@@ -15,7 +15,7 @@ use crate::swarm::members;
use crate::transport::identity::{WHO_LABEL, signed};
use crate::transport::sim::SimNet;
use crate::transport::{
- Destination, HeadsSummary, IdentityProof, Keepalive, ParsedMessage, Transport,
+ Destination, HeadsSummary, IdentityProof, ParsedMessage, Status, Transport,
};
const SOON: Duration = Duration::from_secs(20);
@@ -97,8 +97,8 @@ async fn members_find_each_other_through_the_member_list() {
}
}
-fn ping(node: &AppState) -> ParsedMessage {
- ParsedMessage::Ping(Keepalive {
+fn status(node: &AppState) -> ParsedMessage {
+ ParsedMessage::Status(Status {
heads: HeadsSummary::of(Vec::new()),
epoch: node.local_epoch(),
epoch_seq: 0,
@@ -129,7 +129,7 @@ async fn a_proof_holds_only_at_its_address() {
who(&ghost, "sim:ghost", "sim:b"),
] {
sim.net.inject("ghost", "a", &forged).await.unwrap();
- sim.net.inject("ghost", "a", &ping(&a)).await.unwrap();
+ sim.net.inject("ghost", "a", &status(&a)).await.unwrap();
assert!(a.get_peer_state(&ghost.id()).await.is_none());
}
let counts = a.transport.stats().identity.unwrap().counts;
@@ -140,7 +140,7 @@ async fn a_proof_holds_only_at_its_address() {
.inject("ghost", "a", &who(&ghost, "sim:ghost", "sim:a"))
.await
.unwrap();
- sim.net.inject("ghost", "a", &ping(&a)).await.unwrap();
+ sim.net.inject("ghost", "a", &status(&a)).await.unwrap();
assert!(a.get_peer_state(&ghost.id()).await.is_some());
// Known by its node ID, not by its address.
assert!(a.get_peer_state("ghost").await.is_none());
diff --git a/src/simtest/timing.rs b/src/simtest/timing.rs
index ce1dfd5..20ad15c 100644
--- a/src/simtest/timing.rs
+++ b/src/simtest/timing.rs
@@ -10,7 +10,7 @@ use crate::document::replica::Epoch;
use crate::state::{AppState, Liveness};
use crate::swarm::bootstrap::Start;
use crate::transport::sim::LinkParams;
-use crate::transport::{HeadsSummary, HelloRequest, Keepalive, MessageKind, ParsedMessage, RunId};
+use crate::transport::{HeadsSummary, HelloRequest, MessageKind, ParsedMessage, RunId, Status};
/// Long enough for anything that should happen within a few keepalives.
const SOON: Duration = Duration::from_secs(10);
@@ -311,8 +311,8 @@ async fn late_epoch_does_not_flip_a_peers_epoch() {
handshake: 1,
})
};
- let ping = |epoch: Epoch, epoch_seq: u32| {
- ParsedMessage::Ping(Keepalive {
+ let status = |epoch: Epoch, epoch_seq: u32| {
+ ParsedMessage::Status(Status {
heads: HeadsSummary::of(Vec::new()),
epoch,
epoch_seq,
@@ -336,20 +336,20 @@ async fn late_epoch_does_not_flip_a_peers_epoch() {
// The ghost switched twice; we hear of the second switch first.
sim.net
- .inject("ghost", "a", &ping(epoch(2), 2))
+ .inject("ghost", "a", &status(epoch(2), 2))
.await
.unwrap();
assert_eq!(recorded().await, (Some(epoch(2)), Some(2)));
- // The PING from between the switches arrives late: ignored.
+ // The STATUS from between the switches arrives late: ignored.
sim.net
- .inject("ghost", "a", &ping(epoch(1), 1))
+ .inject("ghost", "a", &status(epoch(1), 1))
.await
.unwrap();
assert_eq!(recorded().await, (Some(epoch(2)), Some(2)));
// So is one from before both.
sim.net
- .inject("ghost", "a", &ping(Epoch::GENESIS, 0))
+ .inject("ghost", "a", &status(Epoch::GENESIS, 0))
.await
.unwrap();
assert_eq!(recorded().await, (Some(epoch(2)), Some(2)));
@@ -366,7 +366,7 @@ async fn late_epoch_does_not_flip_a_peers_epoch() {
Some(second_run)
);
sim.net
- .inject("ghost", "a", &ping(epoch(3), 1))
+ .inject("ghost", "a", &status(epoch(3), 1))
.await
.unwrap();
assert_eq!(recorded().await, (Some(epoch(3)), Some(1)));