Skip to content

Commit

Permalink
Merge branch 'feat/samples_for_session_authenticate' of github.com:Wa…
Browse files Browse the repository at this point in the history
…lletConnect/WalletConnectKotlinV2 into fix/recaps_parsing
  • Loading branch information
jakubuid committed Feb 11, 2024
2 parents 0b09ee5 + b2f655c commit cbda1f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ internal class ValidatorTest {
fun `validate with encoded uri query parameter`() {
val validUri =
"deeplink://wc?uri=wc%3A7f6e504bfad60b485450578e05678ed3e8e8c4751d3c6160be17160d63ec90f9%402%3Frelay-protocol%3Dirn%26symKey%3D587d5484ce2a2a6ee3ba1962fdd7e8588e06200c46823bd18fbd67def96ad303"
//"kotlin-web3wallet://wc?uri=5521cc5969ab1fdc242648d69230534769b74dd770f5379284f67452e16c870a@2?relay-protocol=irn&expiryTimestamp=1706870519&methods=wc_sessionAuthenticate&symKey=e7a471121c212cc370c1a96f1f429b1dd57664f91e504837a19064a4989ec82f"

Validator.validateWCUri("").apply { assertEquals(null, this) }
Validator.validateWCUri(validUri).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ internal class OnSessionAuthenticateResponseUseCase(

val pairingTopic = jsonRpcHistoryEntry.topic
if (!pairingInterface.getPairings().any { pairing -> pairing.topic == pairingTopic.value }) return@supervisorScope //todo: emit error
scope.launch { authenticateResponseTopicRepository.delete(pairingTopic.value) }
runCatching { authenticateResponseTopicRepository.delete(pairingTopic.value) }.onFailure {
logger.error("Received session authenticate response - failed to delete authenticate response topic: ${wcResponse.topic}")
_events.emit(SDKError(it))
}

when (val response = wcResponse.response) {
is JsonRpcResponse.JsonRpcError -> {
Expand Down

0 comments on commit cbda1f7

Please sign in to comment.