Make cli pretty print json (#2130)

This commit is contained in:
Ben Carman 2020-10-06 06:36:03 -05:00 committed by GitHub
parent e75b4ff4c9
commit ef996adccf
2 changed files with 3 additions and 3 deletions

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)
}
}