Skip to content

Commit

Permalink
fix: payment store
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Mar 16, 2024
1 parent 3ba2432 commit 16f35c0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/payment/payment_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ impl Writeable for PaymentDetails {
(4, None::<Option<PaymentSecret>>, required),
(6, self.amount_msat, required),
(8, self.direction, required),
(10, self.status, required)
(10, self.status, required),
(131074, self.last_update, required)
});
Ok(())
}
Expand All @@ -69,7 +70,6 @@ impl Readable for PaymentDetails {
(6, amount_msat, required),
(8, direction, required),
(10, status, required),
(131072, bolt11_invoice, option),
(131074, last_update, required),
});

Expand Down Expand Up @@ -106,7 +106,7 @@ impl Readable for PaymentDetails {
lsp_fee_limits,
}
} else {
PaymentKind::Bolt11 { hash, preimage, secret, bolt11_invoice }
PaymentKind::Bolt11 { hash, preimage, secret, bolt11_invoice: None }
}
} else {
PaymentKind::Spontaneous { hash, preimage }
Expand Down Expand Up @@ -410,7 +410,6 @@ mod tests {
pub direction: PaymentDirection,
pub status: PaymentStatus,
pub lsp_fee_limits: Option<LSPFeeLimits>,
pub bolt11_invoice: Option<String>,
}

impl_writeable_tlv_based!(OldPaymentDetails, {
Expand All @@ -421,7 +420,6 @@ mod tests {
(6, amount_msat, required),
(8, direction, required),
(10, status, required),
(131072, bolt11_invoice, option),
});

#[test]
Expand Down Expand Up @@ -494,7 +492,6 @@ mod tests {
direction: PaymentDirection::Inbound,
status: PaymentStatus::Pending,
lsp_fee_limits: None,
bolt11_invoice: Some(bolt11_invoice.to_string()),
};

let old_bolt11_encoded = old_bolt11_payment.encode();
Expand Down Expand Up @@ -539,7 +536,6 @@ mod tests {
direction: PaymentDirection::Inbound,
status: PaymentStatus::Pending,
lsp_fee_limits,
bolt11_invoice: Some(bolt11_invoice.to_string()),
};

let old_bolt11_jit_encoded = old_bolt11_jit_payment.encode();
Expand Down Expand Up @@ -584,7 +580,6 @@ mod tests {
direction: PaymentDirection::Inbound,
status: PaymentStatus::Pending,
lsp_fee_limits: None,
bolt11_invoice: None,
};

let old_spontaneous_encoded = old_spontaneous_payment.encode();
Expand Down

0 comments on commit 16f35c0

Please sign in to comment.