Skip to content

Commit 6f45bad

Browse files
committed
f consistent naming
1 parent f81b824 commit 6f45bad

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

lightning/src/sign/ecdsa.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ pub trait EcdsaChannelSigner: ChannelSigner {
2929
/// Policy checks should be implemented in this function, including checking the amount
3030
/// sent to us and checking the HTLCs.
3131
///
32-
/// The preimages of outgoing and incoming HTLCs that were fulfilled since the last commitment
33-
/// are provided. A validating signer should ensure that an outgoing HTLC output is removed
34-
/// only when the matching preimage is provided and after the corresponding incoming HTLC has
32+
/// The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
33+
/// are provided. A validating signer should ensure that an outbound HTLC output is removed
34+
/// only when the matching preimage is provided and after the corresponding inbound HTLC has
3535
/// been removed for forwarded payments.
3636
///
3737
/// Note that all the relevant preimages will be provided, but there may also be additional
3838
/// irrelevant or duplicate preimages.
3939
//
4040
// TODO: Document the things someone using this interface should enforce before signing.
4141
fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction,
42-
incoming_preimages: Vec<PaymentPreimage>, outgoing_preimages: Vec<PaymentPreimage>,
43-
secp_ctx: &Secp256k1<secp256k1::All>,
42+
inbound_htlc_preimages: Vec<PaymentPreimage>,
43+
outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>,
4444
) -> Result<(Signature, Vec<Signature>), ()>;
4545
/// Validate the counterparty's revocation.
4646
///

lightning/src/sign/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,14 @@ pub trait ChannelSigner {
594594
/// Policy checks should be implemented in this function, including checking the amount
595595
/// sent to us and checking the HTLCs.
596596
///
597-
/// The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
597+
/// The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
598598
/// A validating signer should ensure that an HTLC output is removed only when the matching
599599
/// preimage is provided, or when the value to holder is restored.
600600
///
601601
/// Note that all the relevant preimages will be provided, but there may also be additional
602602
/// irrelevant or duplicate preimages.
603603
fn validate_holder_commitment(&self, holder_tx: &HolderCommitmentTransaction,
604-
preimages: Vec<PaymentPreimage>) -> Result<(), ()>;
604+
outbound_htlc_preimages: Vec<PaymentPreimage>) -> Result<(), ()>;
605605

606606
/// Returns the holder's channel public keys and basepoints.
607607
fn pubkeys(&self) -> &ChannelPublicKeys;
@@ -1080,7 +1080,7 @@ impl ChannelSigner for InMemorySigner {
10801080
chan_utils::build_commitment_secret(&self.commitment_seed, idx)
10811081
}
10821082

1083-
fn validate_holder_commitment(&self, _holder_tx: &HolderCommitmentTransaction, _preimages: Vec<PaymentPreimage>) -> Result<(), ()> {
1083+
fn validate_holder_commitment(&self, _holder_tx: &HolderCommitmentTransaction, _outbound_htlc_preimages: Vec<PaymentPreimage>) -> Result<(), ()> {
10841084
Ok(())
10851085
}
10861086

@@ -1102,7 +1102,7 @@ impl ChannelSigner for InMemorySigner {
11021102
const MISSING_PARAMS_ERR: &'static str = "ChannelSigner::provide_channel_parameters must be called before signing operations";
11031103

11041104
impl EcdsaChannelSigner for InMemorySigner {
1105-
fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, _inbound_preimages: Vec<PaymentPreimage>, _outbound_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()> {
1105+
fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, _inbound_htlc_preimages: Vec<PaymentPreimage>, _outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()> {
11061106
let trusted_tx = commitment_tx.trust();
11071107
let keys = trusted_tx.keys();
11081108

@@ -1254,7 +1254,7 @@ impl TaprootChannelSigner for InMemorySigner {
12541254
todo!()
12551255
}
12561256

1257-
fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction, incoming_preimages: Vec<PaymentPreimage>, outgoing_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>) -> Result<(PartialSignatureWithNonce, Vec<schnorr::Signature>), ()> {
1257+
fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction, inbound_htlc_preimages: Vec<PaymentPreimage>, outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>) -> Result<(PartialSignatureWithNonce, Vec<schnorr::Signature>), ()> {
12581258
todo!()
12591259
}
12601260

lightning/src/sign/taproot.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ pub trait TaprootChannelSigner: ChannelSigner {
2727
/// Policy checks should be implemented in this function, including checking the amount
2828
/// sent to us and checking the HTLCs.
2929
///
30-
/// The preimages of outgoing and incoming HTLCs that were fulfilled since the last commitment
31-
/// are provided. A validating signer should ensure that an outgoing HTLC output is removed
32-
/// only when the matching preimage is provided and after the corresponding incoming HTLC has
30+
/// The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
31+
/// are provided. A validating signer should ensure that an outbound HTLC output is removed
32+
/// only when the matching preimage is provided and after the corresponding inbound HTLC has
3333
/// been removed for forwarded payments.
3434
///
3535
/// Note that all the relevant preimages will be provided, but there may also be additional
@@ -38,8 +38,8 @@ pub trait TaprootChannelSigner: ChannelSigner {
3838
// TODO: Document the things someone using this interface should enforce before signing.
3939
fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce,
4040
commitment_tx: &CommitmentTransaction,
41-
incoming_preimages: Vec<PaymentPreimage>, outgoing_preimages: Vec<PaymentPreimage>,
42-
secp_ctx: &Secp256k1<secp256k1::All>,
41+
inbound_htlc_preimages: Vec<PaymentPreimage>,
42+
outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>,
4343
) -> Result<(PartialSignatureWithNonce, Vec<Signature>), ()>;
4444

4545
/// Creates a signature for a holder's commitment transaction.

lightning/src/util/test_channel_signer.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl ChannelSigner for TestChannelSigner {
138138
self.inner.release_commitment_secret(idx)
139139
}
140140

141-
fn validate_holder_commitment(&self, holder_tx: &HolderCommitmentTransaction, _preimages: Vec<PaymentPreimage>) -> Result<(), ()> {
141+
fn validate_holder_commitment(&self, holder_tx: &HolderCommitmentTransaction, _outbound_htlc_preimages: Vec<PaymentPreimage>) -> Result<(), ()> {
142142
let mut state = self.state.lock().unwrap();
143143
let idx = holder_tx.commitment_number();
144144
assert!(idx == state.last_holder_commitment || idx == state.last_holder_commitment - 1, "expecting to validate the current or next holder commitment - trying {}, current {}", idx, state.last_holder_commitment);
@@ -156,7 +156,7 @@ impl ChannelSigner for TestChannelSigner {
156156
}
157157

158158
impl EcdsaChannelSigner for TestChannelSigner {
159-
fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, inbound_preimages: Vec<PaymentPreimage>, outbound_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()> {
159+
fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, inbound_htlc_preimages: Vec<PaymentPreimage>, outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()> {
160160
self.verify_counterparty_commitment_tx(commitment_tx, secp_ctx);
161161

162162
{
@@ -175,7 +175,7 @@ impl EcdsaChannelSigner for TestChannelSigner {
175175
state.last_counterparty_commitment = cmp::min(last_commitment_number, actual_commitment_number)
176176
}
177177

178-
Ok(self.inner.sign_counterparty_commitment(commitment_tx, inbound_preimages, outbound_preimages, secp_ctx).unwrap())
178+
Ok(self.inner.sign_counterparty_commitment(commitment_tx, inbound_htlc_preimages, outbound_htlc_preimages, secp_ctx).unwrap())
179179
}
180180

181181
fn validate_counterparty_revocation(&self, idx: u64, _secret: &SecretKey) -> Result<(), ()> {
@@ -288,7 +288,7 @@ impl TaprootChannelSigner for TestChannelSigner {
288288
todo!()
289289
}
290290

291-
fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction, outbound_preimages: Vec<PaymentPreimage>, inbound_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>) -> Result<(PartialSignatureWithNonce, Vec<secp256k1::schnorr::Signature>), ()> {
291+
fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction, inbound_htlc_preimages: Vec<PaymentPreimage>, outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>) -> Result<(PartialSignatureWithNonce, Vec<secp256k1::schnorr::Signature>), ()> {
292292
todo!()
293293
}
294294

0 commit comments

Comments
 (0)