1919 let first_event = logs. next ( ) . ok_or ( InternalReplayError :: NoEvents ) ?. into ( ) ;
2020 let mut session_events = vec ! [ first_event. clone( ) ] ;
2121 let mut sender = match first_event {
22- SessionEvent :: CreatedReplyKey ( reply_key) => SendSession :: new ( * reply_key) ,
22+ SessionEvent :: Created ( reply_key) => SendSession :: new ( * reply_key) ,
2323 _ => return Err ( InternalReplayError :: InvalidEvent ( Box :: new ( first_event) , None ) . into ( ) ) ,
2424 } ;
2525
@@ -61,7 +61,7 @@ impl SessionHistory {
6161 self . events
6262 . iter ( )
6363 . find_map ( |event| match event {
64- SessionEvent :: CreatedReplyKey ( proposal) =>
64+ SessionEvent :: Created ( proposal) =>
6565 Some ( proposal. psbt_ctx . original_psbt . clone ( ) . extract_tx_unchecked_fee_rate ( ) ) ,
6666 _ => None ,
6767 } )
@@ -72,7 +72,7 @@ impl SessionHistory {
7272 self . events
7373 . iter ( )
7474 . find_map ( |event| match event {
75- SessionEvent :: CreatedReplyKey ( proposal) => Some ( & proposal. pj_param ) ,
75+ SessionEvent :: Created ( proposal) => Some ( & proposal. pj_param ) ,
7676 _ => None ,
7777 } )
7878 . expect ( "Session event log must contain at least one event with pj_param" )
@@ -113,9 +113,9 @@ pub enum SessionStatus {
113113#[ derive( Debug , Clone , PartialEq , Eq , serde:: Serialize , serde:: Deserialize ) ]
114114pub enum SessionEvent {
115115 /// Sender was created with a HPKE key pair
116- CreatedReplyKey ( Box < WithReplyKey > ) ,
117- /// Sender POST'd the original PSBT, and waiting to receive a Proposal PSBT using GET context
118- PollingForProposal ( ) ,
116+ Created ( Box < WithReplyKey > ) ,
117+ /// Sender POSTed the Original PSBT and is waiting to receive a Proposal PSBT
118+ PostedOriginalPsbt ( ) ,
119119 /// Sender received a Proposal PSBT
120120 ReceivedProposalPsbt ( bitcoin:: Psbt ) ,
121121 /// Closed successful or failed session
@@ -180,8 +180,8 @@ mod tests {
180180 } ;
181181
182182 let test_cases = vec ! [
183- SessionEvent :: CreatedReplyKey ( Box :: new( sender_with_reply_key. clone( ) ) ) ,
184- SessionEvent :: PollingForProposal ( ) ,
183+ SessionEvent :: Created ( Box :: new( sender_with_reply_key. clone( ) ) ) ,
184+ SessionEvent :: PostedOriginalPsbt ( ) ,
185185 SessionEvent :: ReceivedProposalPsbt ( PARSED_ORIGINAL_PSBT . clone( ) ) ,
186186 SessionEvent :: Closed ( SessionOutcome :: Success ) ,
187187 SessionEvent :: Closed ( SessionOutcome :: Failure ) ,
@@ -259,7 +259,7 @@ mod tests {
259259 } ;
260260 let persister = InMemoryTestPersister :: < SessionEvent > :: default ( ) ;
261261 persister
262- . save_event ( SessionEvent :: CreatedReplyKey ( Box :: new ( with_reply_key) ) )
262+ . save_event ( SessionEvent :: Created ( Box :: new ( with_reply_key) ) )
263263 . expect ( "save_event should succeed" ) ;
264264
265265 let err = replay_event_log ( & persister) . expect_err ( "session should be expired" ) ;
@@ -304,7 +304,7 @@ mod tests {
304304 } ;
305305 let sender = Sender { state : with_reply_key. clone ( ) } ;
306306 let test = SessionHistoryTest {
307- events : vec ! [ SessionEvent :: CreatedReplyKey ( Box :: new( with_reply_key) ) ] ,
307+ events : vec ! [ SessionEvent :: Created ( Box :: new( with_reply_key) ) ] ,
308308 expected_session_history : SessionHistoryExpectedOutcome {
309309 fallback_tx,
310310 pj_param,
@@ -352,7 +352,7 @@ mod tests {
352352 } ;
353353
354354 let events = vec ! [
355- SessionEvent :: CreatedReplyKey ( Box :: new( with_reply_key) ) ,
355+ SessionEvent :: Created ( Box :: new( with_reply_key) ) ,
356356 SessionEvent :: Closed ( SessionOutcome :: Success ) ,
357357 ] ;
358358
0 commit comments