1
0
Fork 0
mirror of https://github.com/bitcoin-s/bitcoin-s.git synced 2025-03-17 13:01:24 +01:00

Make cli pretty print json ()

This commit is contained in:
Ben Carman 2020-10-06 06:36:03 -05:00 committed by GitHub
parent 7bbc89fb33
commit 8c4308e2c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions
app
cli/src/main/scala/org/bitcoins/cli
oracle-server/src/main/scala/org/bitcoins/oracle/server

View file

@ -26,7 +26,7 @@ import org.bitcoins.crypto.{
Sha256DigestBE
}
import scopt.OParser
import ujson.{Num, Str}
import ujson._
import upickle.{default => up}
import scala.collection.mutable
@ -1340,7 +1340,7 @@ object ConsoleCli {
case Str(string) => string
case Num(num) if num.isWhole => num.toLong.toString
case Num(num) => num.toString
case rest: ujson.Value => rest.toString()
case rest: ujson.Value => rest.render(2)
}
(getKey("result"), getKey("error")) match {

View file

@ -33,7 +33,7 @@ case class OracleRoutes(oracle: DLCOracle)(implicit system: ActorSystem)
val nonceStrs = eventDbs.map(_.nonce.hex)
val json = Arr.from(nonceStrs)
Server.httpSuccess(json.render(indent = 2))
Server.httpSuccess(json)
}
}