mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Adjust OutgoingPaymentStatus.completedAt
to be RelayTimestamp
type (#5586)
* Adjust OutgoingPaymentStatus.completedAt to be RelayTimestamp type * Empty commit to re-run CI
This commit is contained in:
parent
05894e8c54
commit
863ffd9d6f
@ -380,10 +380,10 @@ object OutgoingPaymentStatus {
|
|||||||
paymentPreimage: PaymentPreimage,
|
paymentPreimage: PaymentPreimage,
|
||||||
feesPaid: MilliSatoshis,
|
feesPaid: MilliSatoshis,
|
||||||
route: Seq[Hop],
|
route: Seq[Hop],
|
||||||
completedAt: Instant // milliseconds
|
completedAt: RelayTimestamp
|
||||||
) extends OutgoingPaymentStatus
|
) extends OutgoingPaymentStatus
|
||||||
|
|
||||||
case class Failed(failures: Seq[PaymentFailure], completedAt: Instant)
|
case class Failed(failures: Seq[PaymentFailure], completedAt: RelayTimestamp)
|
||||||
extends OutgoingPaymentStatus
|
extends OutgoingPaymentStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1277,8 +1277,8 @@ object JsonReaders {
|
|||||||
preimage <- (js \ "paymentPreimage").validate[PaymentPreimage]
|
preimage <- (js \ "paymentPreimage").validate[PaymentPreimage]
|
||||||
feesPaid <- (js \ "feesPaid").validate[MilliSatoshis]
|
feesPaid <- (js \ "feesPaid").validate[MilliSatoshis]
|
||||||
route <- (js \ "route").validate[Seq[Hop]]
|
route <- (js \ "route").validate[Seq[Hop]]
|
||||||
completed <- (js \ "completedAt" \ "unix")
|
completed <- (js \ "completedAt")
|
||||||
.validate[Instant](instantReadsMilliseconds)
|
.validate[RelayTimestamp]
|
||||||
} yield OutgoingPaymentStatus.Succeeded(
|
} yield OutgoingPaymentStatus.Succeeded(
|
||||||
paymentPreimage = preimage,
|
paymentPreimage = preimage,
|
||||||
feesPaid = feesPaid,
|
feesPaid = feesPaid,
|
||||||
@ -1306,6 +1306,9 @@ object JsonReaders {
|
|||||||
implicit val paymentFailureReads: Reads[PaymentFailure] =
|
implicit val paymentFailureReads: Reads[PaymentFailure] =
|
||||||
Json.reads[PaymentFailure]
|
Json.reads[PaymentFailure]
|
||||||
|
|
||||||
|
implicit val relayTimestampReads: Reads[RelayTimestamp] =
|
||||||
|
Json.reads[RelayTimestamp]
|
||||||
|
|
||||||
implicit val paymentFailedReads: Reads[OutgoingPaymentStatus.Failed] =
|
implicit val paymentFailedReads: Reads[OutgoingPaymentStatus.Failed] =
|
||||||
Json.reads[OutgoingPaymentStatus.Failed]
|
Json.reads[OutgoingPaymentStatus.Failed]
|
||||||
|
|
||||||
@ -1468,8 +1471,6 @@ object JsonReaders {
|
|||||||
|
|
||||||
implicit val sentPaymentReads: Reads[SentPayment] = Json.reads[SentPayment]
|
implicit val sentPaymentReads: Reads[SentPayment] = Json.reads[SentPayment]
|
||||||
|
|
||||||
implicit val relayTimestampReads: Reads[RelayTimestamp] =
|
|
||||||
Json.reads[RelayTimestamp]
|
|
||||||
implicit val relayedPaymentReads: Reads[RelayedPayment] = Reads { js =>
|
implicit val relayedPaymentReads: Reads[RelayedPayment] = Reads { js =>
|
||||||
for {
|
for {
|
||||||
amountIn <- (js \ "amountIn").validate[MilliSatoshis]
|
amountIn <- (js \ "amountIn").validate[MilliSatoshis]
|
||||||
|
Loading…
Reference in New Issue
Block a user