@@ -119,7 +119,7 @@ struct NegotiationContext {
119
119
did_send_tx_signatures : bool ,
120
120
}
121
121
122
- pub ( crate ) struct InteractiveTxStateMachine < S > {
122
+ struct InteractiveTxStateMachine < S > {
123
123
context : NegotiationContext ,
124
124
state : S ,
125
125
}
@@ -284,34 +284,34 @@ impl<S> InteractiveTxStateMachine<S>
284
284
}
285
285
}
286
286
287
- pub ( crate ) fn send_tx_add_input ( mut self , serial_id : u64 , input : TxIn ) -> InteractiveTxStateMachine < Negotiating > {
287
+ fn send_tx_add_input ( mut self , serial_id : u64 , input : TxIn ) -> InteractiveTxStateMachine < Negotiating > {
288
288
self . context . inputs . insert ( serial_id, input) ;
289
289
InteractiveTxStateMachine { context : self . context , state : Negotiating { } }
290
290
}
291
291
292
- pub ( crate ) fn send_tx_add_output ( mut self , serial_id : SerialId , output : TxOut ) -> InteractiveTxStateMachine < Negotiating > {
292
+ fn send_tx_add_output ( mut self , serial_id : SerialId , output : TxOut ) -> InteractiveTxStateMachine < Negotiating > {
293
293
self . context . outputs . insert ( serial_id, output) ;
294
294
InteractiveTxStateMachine { context : self . context , state : Negotiating { } }
295
295
}
296
296
297
- pub ( crate ) fn send_tx_remove_input ( mut self , serial_id : SerialId ) -> InteractiveTxStateMachine < Negotiating > {
297
+ fn send_tx_remove_input ( mut self , serial_id : SerialId ) -> InteractiveTxStateMachine < Negotiating > {
298
298
self . context . inputs . remove ( & serial_id) ;
299
299
InteractiveTxStateMachine { context : self . context , state : Negotiating { } }
300
300
}
301
301
302
- pub ( crate ) fn send_tx_remove_output ( mut self , serial_id : SerialId ) -> InteractiveTxStateMachine < Negotiating > {
302
+ fn send_tx_remove_output ( mut self , serial_id : SerialId ) -> InteractiveTxStateMachine < Negotiating > {
303
303
self . context . outputs . remove ( & serial_id) ;
304
304
InteractiveTxStateMachine { context : self . context , state : Negotiating { } }
305
305
}
306
306
307
- pub ( crate ) fn send_tx_abort ( mut self ) -> InteractiveTxStateMachine < NegotiationAborted > {
307
+ fn send_tx_abort ( mut self ) -> InteractiveTxStateMachine < NegotiationAborted > {
308
308
// A sending node:
309
309
// - MUST NOT have already transmitted tx_signatures
310
310
// - SHOULD forget the current negotiation and reset their state.
311
311
todo ! ( ) ;
312
312
}
313
313
314
- pub ( crate ) fn receive_tx_abort ( mut self ) -> InteractiveTxStateMachine < NegotiationAborted > {
314
+ fn receive_tx_abort ( mut self ) -> InteractiveTxStateMachine < NegotiationAborted > {
315
315
todo ! ( ) ;
316
316
}
317
317
@@ -434,12 +434,12 @@ impl Default for ChannelMode {
434
434
fn default ( ) -> Self { Indeterminate }
435
435
}
436
436
437
- struct InteractiveTxConstructor {
437
+ pub ( crate ) struct InteractiveTxConstructor {
438
438
mode : ChannelMode ,
439
439
}
440
440
441
441
impl InteractiveTxConstructor {
442
- fn new (
442
+ pub ( crate ) fn new (
443
443
channel_id : [ u8 ; 32 ] ,
444
444
require_confirmed_inputs : bool ,
445
445
is_initiator : bool ,
@@ -458,43 +458,43 @@ impl InteractiveTxConstructor {
458
458
}
459
459
}
460
460
461
- fn abort_negotation ( & mut self , reason : AbortReason ) {
461
+ pub ( crate ) fn abort_negotation ( & mut self , reason : AbortReason ) {
462
462
self . handle_negotiating_receive ( |state_machine| state_machine. abort_negotiation ( reason) )
463
463
}
464
464
465
- fn receive_tx_add_input ( & mut self , serial_id : SerialId , transaction_input : TxAddInput , confirmed : bool ) {
465
+ pub ( crate ) fn receive_tx_add_input ( & mut self , serial_id : SerialId , transaction_input : TxAddInput , confirmed : bool ) {
466
466
self . handle_negotiating_receive ( |state_machine| state_machine. receive_tx_add_input ( serial_id, transaction_input, confirmed) )
467
467
}
468
468
469
- fn receive_tx_remove_input ( & mut self , serial_id : SerialId ) {
469
+ pub ( crate ) fn receive_tx_remove_input ( & mut self , serial_id : SerialId ) {
470
470
self . handle_negotiating_receive ( |state_machine| state_machine. receive_tx_remove_input ( serial_id) )
471
471
}
472
472
473
- fn receive_tx_add_output ( & mut self , serial_id : SerialId , output : TxOut ) {
473
+ pub ( crate ) fn receive_tx_add_output ( & mut self , serial_id : SerialId , output : TxOut ) {
474
474
self . handle_negotiating_receive ( |state_machine| state_machine. receive_tx_add_output ( serial_id, output) )
475
475
}
476
476
477
- fn receive_tx_remove_output ( & mut self , serial_id : SerialId ) {
477
+ pub ( crate ) fn receive_tx_remove_output ( & mut self , serial_id : SerialId ) {
478
478
self . handle_negotiating_receive ( |state_machine| state_machine. receive_tx_remove_output ( serial_id) )
479
479
}
480
480
481
- fn send_tx_add_input ( & mut self , serial_id : SerialId , transaction_input : TxIn ) {
481
+ pub ( crate ) fn send_tx_add_input ( & mut self , serial_id : SerialId , transaction_input : TxIn ) {
482
482
self . handle_negotiating_send ( |state_machine| state_machine. send_tx_add_input ( serial_id, transaction_input) )
483
483
}
484
484
485
- fn send_tx_remove_input ( & mut self , serial_id : SerialId ) {
485
+ pub ( crate ) fn send_tx_remove_input ( & mut self , serial_id : SerialId ) {
486
486
self . handle_negotiating_send ( |state_machine| state_machine. send_tx_remove_input ( serial_id) )
487
487
}
488
488
489
- fn send_tx_add_output ( & mut self , serial_id : SerialId , transaction_output : TxOut ) {
489
+ pub ( crate ) fn send_tx_add_output ( & mut self , serial_id : SerialId , transaction_output : TxOut ) {
490
490
self . handle_negotiating_send ( |state_machine| state_machine. send_tx_add_output ( serial_id, transaction_output) )
491
491
}
492
492
493
- fn send_tx_remove_output ( & mut self , serial_id : SerialId ) {
493
+ pub ( crate ) fn send_tx_remove_output ( & mut self , serial_id : SerialId ) {
494
494
self . handle_negotiating_send ( |state_machine| state_machine. send_tx_remove_output ( serial_id) )
495
495
}
496
496
497
- fn send_tx_complete ( & mut self ) {
497
+ pub ( crate ) fn send_tx_complete ( & mut self ) {
498
498
let mut mode = core:: mem:: take ( & mut self . mode ) ;
499
499
self . mode = match mode {
500
500
ChannelMode :: Negotiating ( c) => { ChannelMode :: OurTxComplete ( c. send_tx_complete ( ) ) }
@@ -503,7 +503,7 @@ impl InteractiveTxConstructor {
503
503
}
504
504
}
505
505
506
- fn receive_tx_complete ( & mut self ) {
506
+ pub ( crate ) fn receive_tx_complete ( & mut self ) {
507
507
let mut mode = core:: mem:: take ( & mut self . mode ) ;
508
508
self . mode = match mode {
509
509
ChannelMode :: Negotiating ( c) => {
0 commit comments