Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Nov 15, 2024
1 parent 9fccd85 commit a5e3e41
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sdk/src/main/java/network/xyo/client/node/client/QueryResponse.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package network.xyo.client.node.client

import android.util.Log
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
Expand Down Expand Up @@ -37,12 +38,16 @@ open class QueryResponseWrapper(private val rawResponse: String) {
val payloadsString = tuple[1].toString()
val payloadsArray = JSONArray(payloadsString)
// grab the first payload and see if it is a boundwitness
val bwJson = payloadsArray.get(0) as JSONObject
if (bwJson.get("schema") !== "network.xyo.boundwitness") {
val panelBw = parseBW(bwJson.toString())
panelBoundWitnessBodyJson = panelBw
panelBoundWitnessHash = panelBw?.hash()
try {
val bwJson = payloadsArray.get(0) as JSONObject
if (bwJson.get("schema") !== "network.xyo.boundwitness") {
val panelBw = parseBW(bwJson.toString())
panelBoundWitnessBodyJson = panelBw
panelBoundWitnessHash = panelBw?.hash()

}
} catch (e: Exception) {
Log.i("xyoClient", "skipping bw parsing from payloads")
}
payloads = parsePayloads(payloadsString)
}
Expand Down

0 comments on commit a5e3e41

Please sign in to comment.