Skip to content

Commit

Permalink
Adjust tests to SeenCache changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Aug 16, 2023
1 parent b512f27 commit 777ccf0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libp2p/src/test/kotlin/io/libp2p/pubsub/SeenCacheTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fun createMessage(number: Int): Rpc.Message {
fun createPubsubMessage(number: Int) = TestPubsubMessage(createMessage(number))
fun createPubsubMessage(number: Int, fastId: Int) =
TestPubsubMessage(createMessage(number)).also { it.fastID = fastId }
operator fun SeenCache<*>.minusAssign(msg: PubsubMessage) = this.remove(msg.messageId)

fun assertContainsEntry(cache: SeenCache<String>, fakeMsg: Int) {
assertThat(cache.isSeen(createPubsubMessage(fakeMsg))).isTrue()
Expand Down

0 comments on commit 777ccf0

Please sign in to comment.