Update CachedMessage
This commit is contained in:
parent
2c2e087980
commit
b2381be0ae
@ -150,15 +150,15 @@ impl AnkNetworkMsg {
|
|||||||
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Tsify, Clone)]
|
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Tsify, Clone)]
|
||||||
pub enum CachedMessageStatus {
|
pub enum CachedMessageStatus {
|
||||||
#[default]
|
#[default]
|
||||||
NoStatus,
|
NoStatus,
|
||||||
FaucetWaiting,
|
FaucetWaiting,
|
||||||
FaucetComplete,
|
|
||||||
CipherWaitingTx,
|
CipherWaitingTx,
|
||||||
TxWaitingCipher,
|
TxWaitingCipher,
|
||||||
SentWaitingConfirmation, // we're sender and wait for commited_in to be spent
|
SentWaitingConfirmation, // we're sender and wait for commited_in to be spent
|
||||||
ReceivedMustConfirm, // we're receiver and we spend commited_in to sender
|
ReceivedMustConfirm, // we're receiver and we spend commited_in to sender
|
||||||
MustSpendConfirmation, // we're sender and we must spend confirmed_by
|
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
|
/// Unique struct for both 4nk messages and notification/key exchange, both rust and ts
|
||||||
@ -179,14 +179,15 @@ pub enum CachedMessageStatus {
|
|||||||
pub struct CachedMessage {
|
pub struct CachedMessage {
|
||||||
pub id: u32,
|
pub id: u32,
|
||||||
pub status: CachedMessageStatus,
|
pub status: CachedMessageStatus,
|
||||||
pub ciphertext: Option<String>, // When we receive message we can't decrypt we only have this and commited_in_tx
|
pub ciphertext: Option<String>, // Needed when we are waiting for a key in transaction, discarded after
|
||||||
pub plaintext: Option<String>, // Never None when message sent
|
pub plaintext: Vec<String>, // Append new messages received while in Trusted state
|
||||||
pub commited_in: Option<OutPoint>,
|
pub commited_in: Option<OutPoint>,
|
||||||
pub commitment: Option<String>, // content of the op_return
|
pub tie_by: Option<usize>, // index of the output that ties the proposal
|
||||||
pub sender: Option<String>, // Never None when message sent
|
pub commitment: Option<String>, // content of the op_return
|
||||||
pub recipient: Option<String>, // Never None when message sent
|
pub sender: Option<String>, // Never None when message sent
|
||||||
pub shared_secret: Option<String>, // Never None when message sent
|
pub recipient: Option<String>, // Never None when message sent
|
||||||
pub key: Option<String>, // Never None when message sent
|
pub shared_secret: Option<String>, // Never None when message sent
|
||||||
|
pub key: Option<String>, // Never None when message sent
|
||||||
pub confirmed_by: Option<OutPoint>, // If this None, Sender keeps sending
|
pub confirmed_by: Option<OutPoint>, // If this None, Sender keeps sending
|
||||||
pub timestamp: u64,
|
pub timestamp: u64,
|
||||||
pub error: Option<AnkError>,
|
pub error: Option<AnkError>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user