File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,13 +169,7 @@ impl SenderBuilder {
169169 pj_param : PjParam ,
170170 psbt_ctx : PsbtContext ,
171171 ) -> NextStateTransition < SessionEvent , Sender < WithReplyKey > > {
172- let reply_key = HpkeKeyPair :: gen_keypair ( ) . 0 ;
173- let sender = Sender {
174- state : WithReplyKey ,
175- pj_param : pj_param. clone ( ) ,
176- psbt_ctx : psbt_ctx. clone ( ) ,
177- reply_key : reply_key. clone ( ) ,
178- } ;
172+ let sender = Sender :: new ( pj_param, psbt_ctx) ;
179173 NextStateTransition :: success ( SessionEvent :: Created ( Box :: new ( sender. clone ( ) ) ) , sender)
180174 }
181175}
@@ -261,6 +255,10 @@ impl SendSession {
261255pub struct WithReplyKey ;
262256
263257impl Sender < WithReplyKey > {
258+ fn new ( pj_param : PjParam , psbt_ctx : PsbtContext ) -> Self {
259+ Sender { state : WithReplyKey , pj_param, psbt_ctx, reply_key : HpkeKeyPair :: gen_keypair ( ) . 0 }
260+ }
261+
264262 /// Construct serialized Request and Context from a Payjoin Proposal.
265263 ///
266264 /// Important: This request must not be retried or reused on failure.
You can’t perform that action at this time.
0 commit comments