mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-26 21:42:48 +01:00
Change outpoint output format for cli commands (#3048)
* Change outpoint output format for cli commands * Use lockunspent format * update docs
This commit is contained in:
parent
9b06cdd832
commit
8e29b5c6f6
3 changed files with 14 additions and 5 deletions
|
@ -415,7 +415,7 @@ class RoutesSpec extends AnyWordSpec with ScalatestRouteTest with MockFactory {
|
|||
Get() ~> route ~> check {
|
||||
assert(contentType == `application/json`)
|
||||
assert(
|
||||
responseAs[String] == """{"result":[{"outpoint":"000000000000000000000000000000000000000000000000000000000000000000000000","value":-1}],"error":null}""")
|
||||
responseAs[String] == """{"result":[{"outpoint":{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0},"value":-1}],"error":null}""")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,7 +432,7 @@ class RoutesSpec extends AnyWordSpec with ScalatestRouteTest with MockFactory {
|
|||
Get() ~> route ~> check {
|
||||
assert(contentType == `application/json`)
|
||||
assert(
|
||||
responseAs[String] == """{"result":[{"outpoint":"000000000000000000000000000000000000000000000000000000000000000000000000","value":-1}],"error":null}""")
|
||||
responseAs[String] == """{"result":[{"outpoint":{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0},"value":-1}],"error":null}""")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,10 @@ case class WalletRoutes(wallet: AnyHDWalletApi)(implicit
|
|||
|
||||
private def spendingInfoDbToJson(spendingInfoDb: SpendingInfoDb): Value = {
|
||||
Obj(
|
||||
"outpoint" -> Str(spendingInfoDb.outPoint.hex),
|
||||
"outpoint" -> Obj(
|
||||
"txid" -> Str(spendingInfoDb.txid.hex),
|
||||
"vout" -> Num(spendingInfoDb.outPoint.vout.toLong.toDouble)
|
||||
),
|
||||
"value" -> Num(spendingInfoDb.output.value.satoshis.toLong.toDouble)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -13,11 +13,17 @@ unreserve them with `lockunspent` or they are spent in the blockchain
|
|||
bitcoin-s-cli listreservedutxos
|
||||
[
|
||||
{
|
||||
"outpoint": "1c22634fa282e71866a8b8c6732ec89eb5c46d30f9773486b0ae32770e8109e1",
|
||||
"outpoint": {
|
||||
"txid": "1c22634fa282e71866a8b8c6732ec89eb5c46d30f9773486b0ae32770e8109e1",
|
||||
"vout": 1,
|
||||
},
|
||||
"value": 2000
|
||||
},
|
||||
{
|
||||
"outpoint": "2b12634fa282e71866a8b8c6732ec89eb5c46d30f9773486b0ae32770e810901",
|
||||
"outpoint": {
|
||||
"txid": "2b12634fa282e71866a8b8c6732ec89eb5c46d30f9773486b0ae32770e810901",
|
||||
"vout": 0,
|
||||
},
|
||||
"value": 1000
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue