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