Skip to content

Commit

Permalink
Fixing Double to Long conversion for chainId (#76)
Browse files Browse the repository at this point in the history
Fixing Double to Long conversion for chainId
  • Loading branch information
teresajiar authored Jul 17, 2022
1 parent 1486aa2 commit 4b038f0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun Session.SessionParams.intoMap(params: MutableMap<String, Any?> = mutableMapO

fun Map<String, *>.extractSessionParams(): Session.SessionParams {
val approved = this["approved"] as? Boolean ?: throw IllegalArgumentException("approved missing")
val chainId = this["chainId"] as? Long
val chainId = (this["chainId"] as Double).toLong()
val accounts = nullOnThrow { (this["accounts"] as? List<*>)?.toStringList() }

return Session.SessionParams(approved, chainId, accounts, nullOnThrow { this.extractPeerData() })
Expand Down

0 comments on commit 4b038f0

Please sign in to comment.