-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE2] Added RumorState handler #1890
Conversation
…-daniel-pull-rumor-handler
Pull reviewers statsStats of the last 30 days for popstellar:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clear and clean code!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went quickly over it but looks good to me overall, just a few nitpicks and should be good to merge
import ch.epfl.pop.model.network.method.message.Message | ||
import ch.epfl.pop.model.network.method.{GreetServer, Rumor} | ||
import ch.epfl.pop.model.network.method.{GreetServer, Rumor, RumorState} | ||
import ch.epfl.pop.model.network.{JsonRpcRequest, JsonRpcResponse, MethodType} | ||
import ch.epfl.pop.model.objects.{Base64Data, Channel, PublicKey, RumorData} | ||
import ch.epfl.pop.pubsub.AskPatternConstants | ||
import ch.epfl.pop.pubsub.ClientActor.ClientAnswer | ||
import ch.epfl.pop.pubsub.graph.validators.RpcValidator | ||
import ch.epfl.pop.pubsub.graph.{ErrorCodes, GraphMessage, PipelineError} | ||
import ch.epfl.pop.storage.DbActor | ||
import ch.epfl.pop.storage.DbActor.{DbActorAck, DbActorReadRumor, DbActorReadRumorData} | ||
import ch.epfl.pop.storage.DbActor.{DbActorAck, DbActorGenerateRumorStateAns, DbActorReadRumor, DbActorReadRumorData} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure these imports are necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably there from an old version, will remove
|
||
test("constructor from json works for RumorState") { | ||
val state: Map[PublicKey, Int] = Map( | ||
PublicKey(Base64Data.encode("1")) -> 1, | ||
PublicKey(Base64Data.encode("2")) -> 2, | ||
PublicKey(Base64Data.encode("3")) -> 3 | ||
) | ||
|
||
val rumorState: RumorState = RumorState(state) | ||
|
||
val encodedDecoded = RumorState.buildFromJson(rumorState.toJsonString) | ||
|
||
encodedDecoded.state shouldBe state | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to RumorStateSuite apparently
Quality Gate passed for 'PoP - PoPCHA-Web-Client'Issues Measures |
Quality Gate passed for 'PoP - Be2-Scala'Issues Measures |
Quality Gate passed for 'PoP - Be1-Go'Issues Measures |
Quality Gate passed for 'PoP - Fe1-Web'Issues Measures |
Quality Gate passed for 'PoP - Fe2-Android'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pending on #1889
When receiving a RumorState query, we send back a response with the list of rumors that are missing from the sender