Skip to content

Commit

Permalink
Allow chain changes on session approve (trustwallet#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
vcoolish authored Nov 11, 2021
1 parent 3d4205a commit bc845c6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ open class WCClient (

fun approveSession(accounts: List<String>, chainId: Int): Boolean {
check(handshakeId > 0) { "handshakeId must be greater than 0 on session approve" }

this.chainId = chainId.toString()
val result = WCApproveSessionResponse(
chainId = this.chainId?.toIntOrNull() ?: chainId,
chainId = chainId,
accounts = accounts,
peerId = peerId,
peerMeta = peerMeta
Expand All @@ -180,7 +180,7 @@ open class WCClient (
params = listOf(
WCSessionUpdate(
approved = approved,
chainId = this.chainId?.toIntOrNull() ?: chainId,
chainId = chainId ?: this.chainId?.toIntOrNull(),
accounts = accounts
)
)
Expand Down

0 comments on commit bc845c6

Please sign in to comment.