Update CachedMessage

This commit is contained in:
Sosthene 2024-07-19 22:48:45 +02:00 committed by Nicolas Cantu
parent 2c2e087980
commit b2381be0ae

View File

@ -152,13 +152,13 @@ pub enum CachedMessageStatus {
#[default]
NoStatus,
FaucetWaiting,
FaucetComplete,
CipherWaitingTx,
TxWaitingCipher,
SentWaitingConfirmation, // we're sender and wait for commited_in to be spent
ReceivedMustConfirm, // we're receiver and we spend commited_in to sender
MustSpendConfirmation, // we're sender and we must spend confirmed_by
Complete,
Trusted, // Can receive more messages
Closed, // No more messages will be trusted from this handshake
}
/// Unique struct for both 4nk messages and notification/key exchange, both rust and ts
@ -179,9 +179,10 @@ pub enum CachedMessageStatus {
pub struct CachedMessage {
pub id: u32,
pub status: CachedMessageStatus,
pub ciphertext: Option<String>, // When we receive message we can't decrypt we only have this and commited_in_tx
pub plaintext: Option<String>, // Never None when message sent
pub ciphertext: Option<String>, // Needed when we are waiting for a key in transaction, discarded after
pub plaintext: Vec<String>, // Append new messages received while in Trusted state
pub commited_in: Option<OutPoint>,
pub tie_by: Option<usize>, // index of the output that ties the proposal
pub commitment: Option<String>, // content of the op_return
pub sender: Option<String>, // Never None when message sent
pub recipient: Option<String>, // Never None when message sent