Rename sender session events.#1125
Conversation
Pull Request Test Coverage Report for Build 18203403187Details
💛 - Coveralls |
benalleng
left a comment
There was a problem hiding this comment.
Nice change, I have a nit that i won't push too hard on if others don't feel too strongly about ti but I think it would be nice to have every SessionEvent be syntactically the same with some object + action, i.e.
ReplyKeyGeneratedOriginalPsbtSubmittedProposalReceivedSessionInvalid
|
On the receiver side we named the event to match the apply function. That'd mean reverting I don't think these names are going to be reflective of the actual events however, until the SessionEvents hold exclusively primary information. |
|
The rule of thumb I used for the receiver events is to name the events after the method action that caused it to happen, e.g. |
8f4005c to
160992b
Compare
If we are sticking with "what happened " and not what the event produced then the correct state is when original PSBT was posted . |
|
I will defer to spacebear's comment here about following the naming pattern by the event after the method action that caused it, I'd just like it to be consistent! |
|
For maximum consistency with the Receiver events, ultimately I'd like to see: pub enum SessionEvent {
/// Sender was created with a HPKE key pair
Created(WithReplyKey),
/// Sender POSTed the Original PSBT, and is waiting to receive a Proposal PSBT
PostedOriginalPsbt(),
/// Sender received a Proposal PSBT
RetrievedProposalPsbt(bitcoin::Psbt),
/// Closed session
Closed(SessionOutcome),
}This is highly correlated with #1114 and #1128 and #1119 (comment), so the order in which those get merged matters. |
e5eec21 to
ac73e71
Compare
|
the mutants here are being ignored until we remove |
|
@benalleng looks like #1129 added the same changes for the sender session closing variant . i'll rebase |
a26fd35 to
a1e19bd
Compare
a1e19bd to
0ed4a6f
Compare
spacebear21
left a comment
There was a problem hiding this comment.
ACK, i noticed some formatting issues that I'm surprised weren't caught in CI.
| use ohttp::ClientResponse; | ||
| use serde::{Deserialize, Serialize}; | ||
| pub use session::{replay_event_log, SessionEvent, SessionHistory}; | ||
| pub use session::{replay_event_log, SessionEvent, SessionHistory, SessionOutcome}; |
There was a problem hiding this comment.
SessionOutcome isn't a leftover import here as it is needed for the different close sessionEvents variants . The current state of the code-base also refelects this change which i think was added by Ben since he worked on the close variant . i initially did the same thing which is the reason behind this comment #1125 (comment)
This renames the sender session events to describe what happened instead of what the event produced . Rename sender session events Rename sender session events Rename sender session events Rename sender session events Rename sender session events Rename sender session events
0ed4a6f to
5a62fa9
Compare
This renames the sender session events to describe what happened instead of what the event produced .
This is part of #1119
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.