Skip to content

Commit

Permalink
fix problems after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
haaase committed Dec 9, 2024
1 parent dc56261 commit c649185
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Modules/RDTs/.jvm/src/test/scala/MembershipSuite.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Prop.propBoolean
import org.scalacheck.{Arbitrary, Gen, Prop}
import rdts.base.{Bottom, Lattice, LocalUid, Uid}
import rdts.base.{Lattice, LocalUid}
import rdts.datatypes.experiments.protocols.simplified.GeneralizedPaxos
import rdts.datatypes.experiments.protocols.{Consensus, Membership, simplified}
import rdts.datatypes.experiments.protocols.{Consensus, Membership, paper, simplified}

import scala.util.Try
class MembershipSuite extends munit.ScalaCheckSuite {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ case class Membership[A, C[_], D[_]](
if isMember then
bottomRound.copy(
membershipChanging = true,
membersConsensus = rounds.value.membersConsensus.write(currentMembers + id)
membersConsensus = rounds.value.membersConsensus.propose(currentMembers + id)
)
else bottomRound
}
Expand All @@ -67,7 +67,7 @@ case class Membership[A, C[_], D[_]](
if currentMembers.size > 1 && isMember then // cannot remove last member
bottomRound.copy(
membershipChanging = true,
membersConsensus = rounds.value.membersConsensus.write(currentMembers - id)
membersConsensus = rounds.value.membersConsensus.propose(currentMembers - id)
)
else bottomRound
}
Expand All @@ -80,7 +80,7 @@ case class Membership[A, C[_], D[_]](
def write(value: A)(using LocalUid, Consensus[C], Consensus[D]): Membership[A, C, D] = writeRound {
if !rounds.value.membershipChanging && isMember then
bottomRound.copy(
innerConsensus = rounds.value.innerConsensus.write(value)
innerConsensus = rounds.value.innerConsensus.propose(value)
)
else bottomRound
}
Expand All @@ -93,7 +93,7 @@ case class Membership[A, C[_], D[_]](
val newMembers = rounds.value.membersConsensus.merge(deltaMembers)
val deltaInner = rounds.value.innerConsensus.upkeep()
val newInner = rounds.value.innerConsensus.merge(deltaInner)
(newMembers.read, newInner.read) match
(newMembers.decision, newInner.decision) match
// member consensus reached -> members have changed
case (Some(members), _) =>
assert(!members.isEmpty, "members consensus reached but no members found")
Expand Down

0 comments on commit c649185

Please sign in to comment.