Skip to content

Commit 1d78971

Browse files
committed
Tidy up visibility
1 parent 26ce75f commit 1d78971

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lightning/src/ln/interactivetxs.rs

+20-20
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
}
@@ -288,34 +288,34 @@ impl<S> InteractiveTxStateMachine<S>
288288
}
289289
}
290290

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

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> {
297297
self.context.outputs.insert(serial_id, output);
298298
InteractiveTxStateMachine { context: self.context, state: Negotiating {} }
299299
}
300300

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

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> {
307307
self.context.outputs.remove(&serial_id);
308308
InteractiveTxStateMachine { context: self.context, state: Negotiating {} }
309309
}
310310

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

318-
pub(crate) fn receive_tx_abort(mut self) -> InteractiveTxStateMachine<NegotiationAborted> {
318+
fn receive_tx_abort(mut self) -> InteractiveTxStateMachine<NegotiationAborted> {
319319
todo!();
320320
}
321321

@@ -438,12 +438,12 @@ impl Default for ChannelMode {
438438
fn default() -> Self { Indeterminate }
439439
}
440440

441-
struct InteractiveTxConstructor {
441+
pub(crate) struct InteractiveTxConstructor {
442442
mode: ChannelMode,
443443
}
444444

445445
impl InteractiveTxConstructor {
446-
fn new(
446+
pub(crate) fn new(
447447
channel_id: [u8; 32],
448448
require_confirmed_inputs: bool,
449449
is_initiator: bool,
@@ -462,43 +462,43 @@ impl InteractiveTxConstructor {
462462
}
463463
}
464464

465-
fn abort_negotation(&mut self, reason: AbortReason) {
465+
pub(crate) fn abort_negotation(&mut self, reason: AbortReason) {
466466
self.handle_negotiating_receive(|state_machine| state_machine.abort_negotiation(reason))
467467
}
468468

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) {
470470
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_add_input(serial_id, transaction_input, confirmed))
471471
}
472472

473-
fn receive_tx_remove_input(&mut self, serial_id: SerialId) {
473+
pub(crate) fn receive_tx_remove_input(&mut self, serial_id: SerialId) {
474474
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_remove_input(serial_id))
475475
}
476476

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) {
478478
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_add_output(serial_id, output))
479479
}
480480

481-
fn receive_tx_remove_output(&mut self, serial_id: SerialId) {
481+
pub(crate) fn receive_tx_remove_output(&mut self, serial_id: SerialId) {
482482
self.handle_negotiating_receive(|state_machine| state_machine.receive_tx_remove_output(serial_id))
483483
}
484484

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) {
486486
self.handle_negotiating_send(|state_machine| state_machine.send_tx_add_input(serial_id, transaction_input))
487487
}
488488

489-
fn send_tx_remove_input(&mut self, serial_id: SerialId) {
489+
pub(crate) fn send_tx_remove_input(&mut self, serial_id: SerialId) {
490490
self.handle_negotiating_send(|state_machine| state_machine.send_tx_remove_input(serial_id))
491491
}
492492

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) {
494494
self.handle_negotiating_send(|state_machine| state_machine.send_tx_add_output(serial_id, transaction_output))
495495
}
496496

497-
fn send_tx_remove_output(&mut self, serial_id: SerialId) {
497+
pub(crate) fn send_tx_remove_output(&mut self, serial_id: SerialId) {
498498
self.handle_negotiating_send(|state_machine| state_machine.send_tx_remove_output(serial_id))
499499
}
500500

501-
fn send_tx_complete(&mut self) {
501+
pub(crate) fn send_tx_complete(&mut self) {
502502
let mut mode = core::mem::take(&mut self.mode);
503503
self.mode = match mode {
504504
ChannelMode::Negotiating(c) => { ChannelMode::OurTxComplete(c.send_tx_complete()) }
@@ -507,7 +507,7 @@ impl InteractiveTxConstructor {
507507
}
508508
}
509509

510-
fn receive_tx_complete(&mut self) {
510+
pub(crate) fn receive_tx_complete(&mut self) {
511511
let mut mode = core::mem::take(&mut self.mode);
512512
self.mode = match mode {
513513
ChannelMode::Negotiating(c) => {

0 commit comments

Comments
 (0)