Skip to content

Commit 70f304c

Browse files
authored
Merge pull request #228 from reown-com/develop
BOM_1.4.12
2 parents d2fb746 + b2f2210 commit 70f304c

File tree

25 files changed

+441
-135
lines changed

25 files changed

+441
-135
lines changed

.idea/codeStyles/Project.xml

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
55
const val KEY_SDK_NAME = "SDK_NAME"
66

77
//Latest versions
8-
const val BOM_VERSION = "1.4.11"
9-
const val FOUNDATION_VERSION = "1.4.11"
10-
const val CORE_VERSION = "1.4.11"
11-
const val SIGN_VERSION = "1.4.11"
12-
const val NOTIFY_VERSION = "1.4.11"
13-
const val WALLETKIT_VERSION = "1.4.11"
14-
const val APPKIT_VERSION = "1.4.11"
15-
const val MODAL_CORE_VERSION = "1.4.11"
8+
const val BOM_VERSION = "1.4.12"
9+
const val FOUNDATION_VERSION = "1.4.12"
10+
const val CORE_VERSION = "1.4.12"
11+
const val SIGN_VERSION = "1.4.12"
12+
const val NOTIFY_VERSION = "1.4.12"
13+
const val WALLETKIT_VERSION = "1.4.12"
14+
const val APPKIT_VERSION = "1.4.12"
15+
const val MODAL_CORE_VERSION = "1.4.12"
1616

1717
//Artifact ids
1818
const val ANDROID_BOM = "android-bom"

core/android/src/main/kotlin/com/reown/android/internal/common/json_rpc/domain/relay/RelayJsonRpcInteractor.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ internal class RelayJsonRpcInteractor(
128128
sessionTopic: Topic,
129129
sessionProposalResponse: CoreSignParams.ApprovalParams,
130130
settleRequest: JsonRpcClientSync<*>,
131+
approvedChains: List<String>?,
132+
approvedMethods: List<String>?,
133+
approvedEvents: List<String>?,
134+
sessionProperties: Map<String, String>?,
135+
scopedProperties: Map<String, String>?,
131136
correlationId: Long,
132137
onSuccess: () -> Unit,
133138
onFailure: (Throwable) -> Unit,
@@ -154,6 +159,11 @@ internal class RelayJsonRpcInteractor(
154159
relay.approveSession(
155160
pairingTopic = pairingTopic,
156161
sessionTopic = sessionTopic,
162+
approvedChains = approvedChains,
163+
approvedMethods = approvedMethods,
164+
approvedEvents = approvedEvents,
165+
sessionProperties = sessionProperties,
166+
scopedProperties = scopedProperties,
157167
correlationId = correlationId,
158168
sessionSettlementRequest = encryptedSettlementRequestString,
159169
sessionProposalResponse = encryptedProposalResponseString
@@ -555,4 +565,4 @@ internal class RelayJsonRpcInteractor(
555565
_internalErrors.emit(SDKError(Throwable(errorMessage)))
556566
}
557567
}
558-
}
568+
}

core/android/src/main/kotlin/com/reown/android/internal/common/model/type/RelayJsonRpcInteractorInterface.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ interface RelayJsonRpcInteractorInterface : JsonRpcInteractorInterface {
3434
sessionTopic: Topic,
3535
sessionProposalResponse: CoreSignParams.ApprovalParams,
3636
settleRequest: JsonRpcClientSync<*>,
37+
approvedChains: List<String>? = null,
38+
approvedMethods: List<String>? = null,
39+
approvedEvents: List<String>? = null,
40+
sessionProperties: Map<String, String>? = null,
41+
scopedProperties: Map<String, String>? = null,
3742
correlationId: Long,
3843
onSuccess: () -> Unit,
3944
onFailure: (Throwable) -> Unit,
@@ -107,4 +112,4 @@ interface RelayJsonRpcInteractorInterface : JsonRpcInteractorInterface {
107112
onSuccess: () -> Unit = {},
108113
onFailure: (Throwable) -> Unit = {},
109114
)
110-
}
115+
}

core/android/src/test/kotlin/com/reown/android/internal/domain/RelayerInteractorTest.kt

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,22 @@ internal class RelayerInteractorTest {
298298
}
299299
val correlationId = 1234L
300300

301-
every { relay.approveSession(any(), any(), any(), any(), any(), any(), any()) } answers {
301+
every {
302+
relay.approveSession(
303+
any(),
304+
any(),
305+
any(),
306+
any(),
307+
any(),
308+
any(),
309+
any(),
310+
any(),
311+
any(),
312+
any(),
313+
any(),
314+
any()
315+
)
316+
} answers {
302317
lastArg<(Result<Relay.Model.Call.ApproveSession.Acknowledgement>) -> Unit>().invoke(
303318
Result.success(mockk())
304319
)
@@ -327,7 +342,22 @@ internal class RelayerInteractorTest {
327342
}
328343
val correlationId = 1234L
329344

330-
every { relay.approveSession(any(), any(), any(), any(), any(), any(), any()) } answers {
345+
every {
346+
relay.approveSession(
347+
any(),
348+
any(),
349+
any(),
350+
any(),
351+
any(),
352+
any(),
353+
any(),
354+
any(),
355+
any(),
356+
any(),
357+
any(),
358+
any()
359+
)
360+
} answers {
331361
lastArg<(Result<Relay.Model.Call.ApproveSession.Acknowledgement>) -> Unit>().invoke(
332362
Result.failure(Throwable("Session approve error"))
333363
)
@@ -370,4 +400,4 @@ internal class RelayerInteractorTest {
370400
verify { onFailure wasNot Called }
371401
verify { onSuccess wasNot Called }
372402
}
373-
}
403+
}

foundation/src/main/kotlin/com/reown/foundation/network/BaseRelayClient.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ abstract class BaseRelayClient : RelayInterface {
170170
sessionTopic: Topic,
171171
sessionProposalResponse: String,
172172
sessionSettlementRequest: String,
173+
approvedChains: List<String>?,
174+
approvedMethods: List<String>?,
175+
approvedEvents: List<String>?,
176+
sessionProperties: Map<String, String>?,
177+
scopedProperties: Map<String, String>?,
173178
correlationId: Long,
174179
id: Long?,
175180
onResult: (Result<Relay.Model.Call.ApproveSession.Acknowledgement>) -> Unit,
@@ -181,6 +186,11 @@ abstract class BaseRelayClient : RelayInterface {
181186
sessionTopic = sessionTopic,
182187
sessionProposalResponse = sessionProposalResponse,
183188
sessionSettlementRequest = sessionSettlementRequest,
189+
approvedChains = approvedChains,
190+
approvedMethods = approvedMethods,
191+
approvedEvents = approvedEvents,
192+
sessionProperties = sessionProperties,
193+
scopedProperties = scopedProperties,
184194
correlationId = correlationId
185195
)
186196
val approveSessionRequest = RelayDTO.ApproveSession.Request(id = id ?: generateClientToServerId(), params = approveSessionParams)
@@ -530,4 +540,4 @@ abstract class BaseRelayClient : RelayInterface {
530540
const val CONNECTION_TIMEOUT: Long = 15000
531541
const val MAX_RETRIES: Int = 3
532542
}
533-
}
543+
}

foundation/src/main/kotlin/com/reown/foundation/network/RelayInterface.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ interface RelayInterface {
2323
sessionTopic: Topic,
2424
sessionProposalResponse: String,
2525
sessionSettlementRequest: String,
26+
approvedChains: List<String>? = null,
27+
approvedMethods: List<String>? = null,
28+
approvedEvents: List<String>? = null,
29+
sessionProperties: Map<String, String>? = null,
30+
scopedProperties: Map<String, String>? = null,
2631
correlationId: Long,
2732
id: Long? = null,
2833
onResult: (Result<Relay.Model.Call.ApproveSession.Acknowledgement>) -> Unit,
@@ -46,4 +51,4 @@ interface RelayInterface {
4651
id: Long? = null,
4752
onResult: (Result<Relay.Model.Call.Unsubscribe.Acknowledgement>) -> Unit,
4853
)
49-
}
54+
}

foundation/src/main/kotlin/com/reown/foundation/network/model/Relay.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ object Relay {
5252
val sessionTopic: String,
5353
val sessionProposalResponse: String,
5454
val sessionSettlementRequest: String,
55+
val approvedChains: List<String>? = null,
56+
val approvedMethods: List<String>? = null,
57+
val approvedEvents: List<String>? = null,
58+
val sessionProperties: Map<String, String>? = null,
59+
val scopedProperties: Map<String, String>? = null,
5560
val correlationId: Long
5661
)
5762
}
@@ -256,4 +261,4 @@ object Relay {
256261
val prompt: Boolean = false
257262
) : Model()
258263
}
259-
}
264+
}

foundation/src/main/kotlin/com/reown/foundation/network/model/RelayDTO.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ sealed class RelayDTO {
9393
val sessionProposalResponse: String,
9494
@Json(name = "sessionSettlementRequest")
9595
val sessionSettlementRequest: String,
96+
@Json(name = "approvedChains")
97+
val approvedChains: List<String>?,
98+
@Json(name = "approvedMethods")
99+
val approvedMethods: List<String>?,
100+
@Json(name = "approvedEvents")
101+
val approvedEvents: List<String>?,
102+
@Json(name = "sessionProperties")
103+
val sessionProperties: Map<String, String>?,
104+
@Json(name = "scopedProperties")
105+
val scopedProperties: Map<String, String>?,
96106
@Json(name = "correlationId")
97107
val correlationId: Long
98108
)
@@ -401,4 +411,4 @@ sealed class RelayDTO {
401411
) {
402412
val errorMessage: String = "Error code: $code; Error message: $message"
403413
}
404-
}
414+
}

foundation/src/test/kotlin/com/reown/foundation/BaseRelayClientTest.kt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,14 @@ class BaseRelayClientTest {
394394

395395
client.observeResults()
396396
client.connectionState.value = ConnectionState.Open
397-
client.approveSession(pairingTopic, sessionTopic, sessionProposalResponse, sessionSettlementRequest, correlationId, expectedId) { result ->
397+
client.approveSession(
398+
pairingTopic = pairingTopic,
399+
sessionTopic = sessionTopic,
400+
sessionProposalResponse = sessionProposalResponse,
401+
sessionSettlementRequest = sessionSettlementRequest,
402+
correlationId = correlationId,
403+
id = expectedId
404+
) { result ->
398405
result.fold(
399406
onSuccess = {
400407
assertEquals(expectedId, result.getOrNull()?.id)
@@ -418,7 +425,13 @@ class BaseRelayClientTest {
418425
coEvery { relayServiceMock.observeApproveSessionAcknowledgement() } returns flow { delay(10000L) }
419426

420427
client.connectionState.value = ConnectionState.Open
421-
client.approveSession(pairingTopic, sessionTopic, sessionProposalResponse, sessionSettlementRequest, correlationId) { result ->
428+
client.approveSession(
429+
pairingTopic = pairingTopic,
430+
sessionTopic = sessionTopic,
431+
sessionProposalResponse = sessionProposalResponse,
432+
sessionSettlementRequest = sessionSettlementRequest,
433+
correlationId = correlationId
434+
) { result ->
422435
result.fold(
423436
onSuccess = {
424437
fail("Should not be successful")
@@ -455,7 +468,14 @@ class BaseRelayClientTest {
455468

456469
client.observeResults()
457470
client.connectionState.value = ConnectionState.Open
458-
client.approveSession(pairingTopic, sessionTopic, sessionProposalResponse, sessionSettlementRequest, correlationId, expectedId) { result ->
471+
client.approveSession(
472+
pairingTopic = pairingTopic,
473+
sessionTopic = sessionTopic,
474+
sessionProposalResponse = sessionProposalResponse,
475+
sessionSettlementRequest = sessionSettlementRequest,
476+
correlationId = correlationId,
477+
id = expectedId
478+
) { result ->
459479
result.fold(
460480
onSuccess = {
461481
fail("Should not be successful")
@@ -468,4 +488,4 @@ class BaseRelayClientTest {
468488

469489
coVerify { relayServiceMock.approveSessionRequest(any()) }
470490
}
471-
}
491+
}

0 commit comments

Comments
 (0)