Skip to content

Commit afafb0e

Browse files
committed
test(ffi/kotlin): remove unused argument of initCc()
1 parent 835473e commit afafb0e

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

crypto-ffi/bindings/shared/src/commonTest/kotlin/com/wire/crypto/MLSTest.kt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MLSTest : HasMockDeliveryService() {
2525

2626
@Test
2727
fun set_client_data_persists() = runTest {
28-
val cc = initCc(this@MLSTest)
28+
val cc = initCc()
2929

3030
val data = "my message processing checkpoint".toByteArray()
3131

@@ -39,7 +39,7 @@ class MLSTest : HasMockDeliveryService() {
3939

4040
@Test
4141
fun interaction_with_invalid_context_throws_error() = runTest {
42-
val cc = initCc(this@MLSTest)
42+
val cc = initCc()
4343
var context: CoreCryptoContext? = null
4444

4545
cc.transaction { ctx -> context = ctx }
@@ -54,7 +54,7 @@ class MLSTest : HasMockDeliveryService() {
5454

5555
@Test
5656
fun error_is_propagated_by_transaction() = runTest {
57-
val cc = initCc(this@MLSTest)
57+
val cc = initCc()
5858
val expectedException = RuntimeException("Expected Exception")
5959

6060
val actualException =
@@ -303,7 +303,7 @@ class MLSTest : HasMockDeliveryService() {
303303

304304
@Test
305305
fun givenTransactionRunsSuccessfully_thenShouldBeAbleToFinishOtherTransactions() = runTest {
306-
val coreCrypto = initCc(this@MLSTest)
306+
val coreCrypto = initCc()
307307
val someWork = Job()
308308
val firstTransactionJob = launch {
309309
coreCrypto.transaction {
@@ -324,7 +324,7 @@ class MLSTest : HasMockDeliveryService() {
324324

325325
@Test
326326
fun givenTransactionIsCancelled_thenShouldBeAbleToFinishOtherTransactions() = runTest {
327-
val coreCrypto = initCc(this@MLSTest)
327+
val coreCrypto = initCc()
328328

329329
val firstTransactionJob = launch {
330330
coreCrypto.transaction {
@@ -529,7 +529,7 @@ class MLSTest : HasMockDeliveryService() {
529529
val clientId = genClientId()
530530
val credential = Credential.basic(CIPHERSUITE_DEFAULT, clientId)
531531

532-
val cc = initCc(this@MLSTest)
532+
val cc = initCc()
533533
val ref = cc.transaction { ctx ->
534534
ctx.mlsInitShort(clientId)
535535
ctx.addCredential(credential)
@@ -550,7 +550,7 @@ class MLSTest : HasMockDeliveryService() {
550550
val clientId = genClientId()
551551
val credential = Credential.basic(CIPHERSUITE_DEFAULT, clientId)
552552

553-
val cc = initCc(this@MLSTest)
553+
val cc = initCc()
554554
val ref = cc.transaction { ctx ->
555555
ctx.mlsInitShort(clientId)
556556
ctx.addCredential(credential)
@@ -577,7 +577,7 @@ class MLSTest : HasMockDeliveryService() {
577577
Ciphersuite.MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_ED25519
578578
val credential2 = Credential.basic(ciphersuite2, clientId)
579579

580-
val cc = initCc(this@MLSTest)
580+
val cc = initCc()
581581
cc.transaction { ctx ->
582582
ctx.mlsInitShort(clientId)
583583
ctx.addCredential(credential1)
@@ -616,7 +616,7 @@ class MLSTest : HasMockDeliveryService() {
616616
val clientId = genClientId()
617617
val credential = Credential.basic(CIPHERSUITE_DEFAULT, clientId)
618618

619-
val cc = initCc(this@MLSTest)
619+
val cc = initCc()
620620
val credentialRef = cc.transaction { ctx ->
621621
ctx.mlsInitShort(clientId)
622622
ctx.addCredential(credential)
@@ -637,7 +637,7 @@ class MLSTest : HasMockDeliveryService() {
637637
val clientId = genClientId()
638638
val credential = Credential.basic(CIPHERSUITE_DEFAULT, clientId)
639639

640-
val cc = initCc(this@MLSTest)
640+
val cc = initCc()
641641
val credentialRef = cc.transaction { ctx ->
642642
ctx.mlsInitShort(clientId)
643643
ctx.addCredential(credential)
@@ -666,7 +666,7 @@ class MLSTest : HasMockDeliveryService() {
666666
val clientId = genClientId()
667667
val credential = Credential.basic(CIPHERSUITE_DEFAULT, clientId)
668668

669-
val cc = initCc(this@MLSTest)
669+
val cc = initCc()
670670
val credentialRef = cc.transaction { ctx ->
671671
ctx.mlsInitShort(clientId)
672672
ctx.addCredential(credential)
@@ -693,7 +693,7 @@ class MLSTest : HasMockDeliveryService() {
693693
val clientId = genClientId()
694694
val credential = Credential.basic(CIPHERSUITE_DEFAULT, clientId)
695695

696-
val cc = initCc(this@MLSTest)
696+
val cc = initCc()
697697
val credentialRef = cc.transaction { ctx ->
698698
ctx.mlsInitShort(clientId)
699699
ctx.addCredential(credential)
@@ -737,7 +737,7 @@ class MLSTest : HasMockDeliveryService() {
737737
clientId
738738
)
739739

740-
val cc = initCc(this@MLSTest)
740+
val cc = initCc()
741741

742742
cc.transaction { ctx ->
743743
ctx.mlsInitShort(clientId)

crypto-ffi/bindings/shared/src/commonTest/kotlin/com/wire/crypto/testutils/TestUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ abstract class HasMockDeliveryService {
106106

107107
fun newClients(instance: HasMockDeliveryService, vararg clientIds: ClientId) = runBlocking {
108108
clientIds.map { clientID ->
109-
val cc = initCc(instance)
109+
val cc = initCc()
110110
cc.transaction { ctx ->
111111
ctx.mlsInitShort(clientID)
112112
ctx.addCredential(Credential.basic(CIPHERSUITE_DEFAULT, clientID))
@@ -115,7 +115,7 @@ fun newClients(instance: HasMockDeliveryService, vararg clientIds: ClientId) = r
115115
}
116116
}
117117

118-
fun initCc(_instance: HasMockDeliveryService): CoreCrypto = runBlocking {
118+
fun initCc(): CoreCrypto = runBlocking {
119119
val root = Files.createTempDirectory("mls").toFile()
120120
val path = root.resolve("keystore-${randomIdentifier()}")
121121
val key = genDatabaseKey()

0 commit comments

Comments
 (0)