mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 21:46:45 +01:00
Solving parsing issue with NWC
This commit is contained in:
@@ -37,9 +37,9 @@ class PayInvoiceSuccessResponse(
|
|||||||
val result: PayInvoiceResultParams? = null,
|
val result: PayInvoiceResultParams? = null,
|
||||||
) : Response("pay_invoice") {
|
) : Response("pay_invoice") {
|
||||||
class PayInvoiceResultParams(
|
class PayInvoiceResultParams(
|
||||||
val preimage: String,
|
val preimage: String? = null,
|
||||||
) {
|
) {
|
||||||
fun countMemory(): Long = pointerSizeInBytes + preimage.bytesUsedInMemory()
|
fun countMemory(): Long = pointerSizeInBytes + (preimage?.bytesUsedInMemory() ?: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun countMemory(): Long = pointerSizeInBytes + (result?.countMemory() ?: 0)
|
override fun countMemory(): Long = pointerSizeInBytes + (result?.countMemory() ?: 0)
|
||||||
@@ -49,8 +49,8 @@ class PayInvoiceErrorResponse(
|
|||||||
val error: PayInvoiceErrorParams? = null,
|
val error: PayInvoiceErrorParams? = null,
|
||||||
) : Response("pay_invoice") {
|
) : Response("pay_invoice") {
|
||||||
class PayInvoiceErrorParams(
|
class PayInvoiceErrorParams(
|
||||||
val code: ErrorType?,
|
val code: ErrorType? = null,
|
||||||
val message: String?,
|
val message: String? = null,
|
||||||
) {
|
) {
|
||||||
fun countMemory(): Long = pointerSizeInBytes + pointerSizeInBytes + (message?.bytesUsedInMemory() ?: 0)
|
fun countMemory(): Long = pointerSizeInBytes + pointerSizeInBytes + (message?.bytesUsedInMemory() ?: 0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user