Skip to content

Commit c2c3328

Browse files
committed
Tidy up visibility
1 parent 260e49c commit c2c3328

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lightning/src/ln/interactivetxs.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct NegotiationContext {
119119
did_send_tx_signatures: bool,
120120
}
121121

122-
pub(crate) struct InteractiveTxStateMachine<S> {
122+
struct InteractiveTxStateMachine<S> {
123123
context: NegotiationContext,
124124
state: S,
125125
}
@@ -284,34 +284,34 @@ impl<S> InteractiveTxStateMachine<S>
284284
}
285285
}
286286

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> {
288288
self.context.inputs.insert(serial_id, input);
289289
InteractiveTxStateMachine { context: self.context, state: Negotiating {} }
290290
}
291291

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> {
293293
self.context.outputs.insert(serial_id, output);
294294
InteractiveTxStateMachine { context: self.context, state: Negotiating {} }
295295
}
296296

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> {
298298
self.context.inputs.remove(&serial_id);
299299
InteractiveTxStateMachine { context: self.context, state: Negotiating {} }
300300
}
301301

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> {
303303
self.context.outputs.remove(&serial_id);
304304
InteractiveTxStateMachine { context: self.context, state: Negotiating {} }
305305
}
306306

307-
pub(crate) fn send_tx_abort(mut self) -> InteractiveTxStateMachine<NegotiationAborted> {
307+
fn send_tx_abort(mut self) -> InteractiveTxStateMachine<NegotiationAborted> {
308308
// A sending node:
309309
// - MUST NOT have already transmitted tx_signatures
310310
// - SHOULD forget the current negotiation and reset their state.
311311
todo!();
312312
}
313313

314-
pub(crate) fn receive_tx_abort(mut self) -> InteractiveTxStateMachine<NegotiationAborted> {
314+
fn receive_tx_abort(mut self) -> InteractiveTxStateMachine<NegotiationAborted> {
315315
todo!();
316316
}
317317

@@ -434,12 +434,12 @@ impl Default for ChannelMode {
434434
fn default() -> Self { Indeterminate }
435435
}
436436

437-
struct InteractiveTxConstructor {
437+
pub(crate) struct InteractiveTxConstructor {
438438
mode: ChannelMode,
439439
}
440440

441441
impl InteractiveTxConstructor {
442-
fn new(
442+
pub(crate) fn new(
443443
channel_id: [u8; 32],
444444
require_confirmed_inputs: bool,
445445
is_initiator: bool,
@@ -458,43 +458,43 @@ impl InteractiveTxConstructor {
458458
}
459459
}
460460

461-
fn abort_negotation(&mut self, reason: AbortReason) {
461+
pub(crate) fn abort_negotation(&mut self, reason: AbortReason) {
462462
self.handle_negotiating_receive(|state_machine| state_machine.abort_negotiation(reason))
463463
}
464464

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) {
466466
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_add_input(serial_id, transaction_input, confirmed))
467467
}
468468

469-
fn receive_tx_remove_input(&mut self, serial_id: SerialId) {
469+
pub(crate) fn receive_tx_remove_input(&mut self, serial_id: SerialId) {
470470
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_remove_input(serial_id))
471471
}
472472

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) {
474474
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_add_output(serial_id, output))
475475
}
476476

477-
fn receive_tx_remove_output(&mut self, serial_id: SerialId) {
477+
pub(crate) fn receive_tx_remove_output(&mut self, serial_id: SerialId) {
478478
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_remove_output(serial_id))
479479
}
480480

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) {
482482
self.handle_negotiating_send(|state_machine| state_machine.send_tx_add_input(serial_id, transaction_input))
483483
}
484484

485-
fn send_tx_remove_input(&mut self, serial_id: SerialId) {
485+
pub(crate) fn send_tx_remove_input(&mut self, serial_id: SerialId) {
486486
self.handle_negotiating_send(|state_machine| state_machine.send_tx_remove_input(serial_id))
487487
}
488488

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) {
490490
self.handle_negotiating_send(|state_machine| state_machine.send_tx_add_output(serial_id, transaction_output))
491491
}
492492

493-
fn send_tx_remove_output(&mut self, serial_id: SerialId) {
493+
pub(crate) fn send_tx_remove_output(&mut self, serial_id: SerialId) {
494494
self.handle_negotiating_send(|state_machine| state_machine.send_tx_remove_output(serial_id))
495495
}
496496

497-
fn send_tx_complete(&mut self) {
497+
pub(crate) fn send_tx_complete(&mut self) {
498498
let mut mode = core::mem::take(&mut self.mode);
499499
self.mode = match mode {
500500
ChannelMode::Negotiating(c) => { ChannelMode::OurTxComplete(c.send_tx_complete()) }
@@ -503,7 +503,7 @@ impl InteractiveTxConstructor {
503503
}
504504
}
505505

506-
fn receive_tx_complete(&mut self) {
506+
pub(crate) fn receive_tx_complete(&mut self) {
507507
let mut mode = core::mem::take(&mut self.mode);
508508
self.mode = match mode {
509509
ChannelMode::Negotiating(c) => {

0 commit comments

Comments
 (0)