Skip to content

Commit d164758

Browse files
committed
pub(crate) visibility for offers/test_utils.rs
The test utilities for Offers are needed for testing message handling in ChannelManager and OutboundPayments.
1 parent b583351 commit d164758

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lightning/src/offers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ mod payer;
2424
pub mod refund;
2525
pub(crate) mod signer;
2626
#[cfg(test)]
27-
mod test_utils;
27+
pub(crate) mod test_utils;

lightning/src/offers/test_utils.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,46 @@ use crate::ln::features::BlindedHopFeatures;
2020
use crate::offers::invoice::BlindedPayInfo;
2121
use crate::offers::merkle::TaggedHash;
2222

23-
pub(super) fn payer_keys() -> KeyPair {
23+
pub(crate) fn payer_keys() -> KeyPair {
2424
let secp_ctx = Secp256k1::new();
2525
KeyPair::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap())
2626
}
2727

28-
pub(super) fn payer_sign<T: AsRef<TaggedHash>>(message: &T) -> Result<Signature, Infallible> {
28+
pub(crate) fn payer_sign<T: AsRef<TaggedHash>>(message: &T) -> Result<Signature, Infallible> {
2929
let secp_ctx = Secp256k1::new();
3030
let keys = KeyPair::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
3131
Ok(secp_ctx.sign_schnorr_no_aux_rand(message.as_ref().as_digest(), &keys))
3232
}
3333

34-
pub(super) fn payer_pubkey() -> PublicKey {
34+
pub(crate) fn payer_pubkey() -> PublicKey {
3535
payer_keys().public_key()
3636
}
3737

38-
pub(super) fn recipient_keys() -> KeyPair {
38+
pub(crate) fn recipient_keys() -> KeyPair {
3939
let secp_ctx = Secp256k1::new();
4040
KeyPair::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[43; 32]).unwrap())
4141
}
4242

43-
pub(super) fn recipient_sign<T: AsRef<TaggedHash>>(message: &T) -> Result<Signature, Infallible> {
43+
pub(crate) fn recipient_sign<T: AsRef<TaggedHash>>(message: &T) -> Result<Signature, Infallible> {
4444
let secp_ctx = Secp256k1::new();
4545
let keys = KeyPair::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[43; 32]).unwrap());
4646
Ok(secp_ctx.sign_schnorr_no_aux_rand(message.as_ref().as_digest(), &keys))
4747
}
4848

49-
pub(super) fn recipient_pubkey() -> PublicKey {
49+
pub(crate) fn recipient_pubkey() -> PublicKey {
5050
recipient_keys().public_key()
5151
}
5252

53-
pub(super) fn pubkey(byte: u8) -> PublicKey {
53+
pub(crate) fn pubkey(byte: u8) -> PublicKey {
5454
let secp_ctx = Secp256k1::new();
5555
PublicKey::from_secret_key(&secp_ctx, &privkey(byte))
5656
}
5757

58-
pub(super) fn privkey(byte: u8) -> SecretKey {
58+
pub(crate) fn privkey(byte: u8) -> SecretKey {
5959
SecretKey::from_slice(&[byte; 32]).unwrap()
6060
}
6161

62-
pub(super) fn payment_paths() -> Vec<(BlindedPayInfo, BlindedPath)> {
62+
pub(crate) fn payment_paths() -> Vec<(BlindedPayInfo, BlindedPath)> {
6363
let paths = vec![
6464
BlindedPath {
6565
introduction_node_id: pubkey(40),
@@ -101,17 +101,17 @@ pub(super) fn payment_paths() -> Vec<(BlindedPayInfo, BlindedPath)> {
101101
payinfo.into_iter().zip(paths.into_iter()).collect()
102102
}
103103

104-
pub(super) fn payment_hash() -> PaymentHash {
104+
pub(crate) fn payment_hash() -> PaymentHash {
105105
PaymentHash([42; 32])
106106
}
107107

108-
pub(super) fn now() -> Duration {
108+
pub(crate) fn now() -> Duration {
109109
std::time::SystemTime::now()
110110
.duration_since(std::time::SystemTime::UNIX_EPOCH)
111111
.expect("SystemTime::now() should come after SystemTime::UNIX_EPOCH")
112112
}
113113

114-
pub(super) struct FixedEntropy;
114+
pub(crate) struct FixedEntropy;
115115

116116
impl EntropySource for FixedEntropy {
117117
fn get_secure_random_bytes(&self) -> [u8; 32] {

0 commit comments

Comments
 (0)