@@ -121,9 +121,9 @@ pub struct BlindedHop {
121
121
122
122
impl BlindedPath {
123
123
/// Create a one-hop blinded path for a message.
124
- pub fn one_hop_for_message < ES : EntropySource + ? Sized , T : secp256k1:: Signing + secp256k1:: Verification > (
125
- recipient_node_id : PublicKey , entropy_source : & ES , secp_ctx : & Secp256k1 < T >
126
- ) -> Result < Self , ( ) > {
124
+ pub fn one_hop_for_message < ES : Deref , T : secp256k1:: Signing + secp256k1:: Verification > (
125
+ recipient_node_id : PublicKey , entropy_source : ES , secp_ctx : & Secp256k1 < T >
126
+ ) -> Result < Self , ( ) > where ES :: Target : EntropySource {
127
127
Self :: new_for_message ( & [ recipient_node_id] , entropy_source, secp_ctx)
128
128
}
129
129
@@ -132,9 +132,9 @@ impl BlindedPath {
132
132
///
133
133
/// Errors if no hops are provided or if `node_pk`(s) are invalid.
134
134
// TODO: make all payloads the same size with padding + add dummy hops
135
- pub fn new_for_message < ES : EntropySource + ? Sized , T : secp256k1:: Signing + secp256k1:: Verification > (
136
- node_pks : & [ PublicKey ] , entropy_source : & ES , secp_ctx : & Secp256k1 < T >
137
- ) -> Result < Self , ( ) > {
135
+ pub fn new_for_message < ES : Deref , T : secp256k1:: Signing + secp256k1:: Verification > (
136
+ node_pks : & [ PublicKey ] , entropy_source : ES , secp_ctx : & Secp256k1 < T >
137
+ ) -> Result < Self , ( ) > where ES :: Target : EntropySource {
138
138
if node_pks. is_empty ( ) { return Err ( ( ) ) }
139
139
let blinding_secret_bytes = entropy_source. get_secure_random_bytes ( ) ;
140
140
let blinding_secret = SecretKey :: from_slice ( & blinding_secret_bytes[ ..] ) . expect ( "RNG is busted" ) ;
@@ -148,10 +148,10 @@ impl BlindedPath {
148
148
}
149
149
150
150
/// Create a one-hop blinded path for a payment.
151
- pub fn one_hop_for_payment < ES : EntropySource + ? Sized , T : secp256k1:: Signing + secp256k1:: Verification > (
151
+ pub fn one_hop_for_payment < ES : Deref , T : secp256k1:: Signing + secp256k1:: Verification > (
152
152
payee_node_id : PublicKey , payee_tlvs : payment:: ReceiveTlvs , min_final_cltv_expiry_delta : u16 ,
153
- entropy_source : & ES , secp_ctx : & Secp256k1 < T >
154
- ) -> Result < ( BlindedPayInfo , Self ) , ( ) > {
153
+ entropy_source : ES , secp_ctx : & Secp256k1 < T >
154
+ ) -> Result < ( BlindedPayInfo , Self ) , ( ) > where ES :: Target : EntropySource {
155
155
// This value is not considered in pathfinding for 1-hop blinded paths, because it's intended to
156
156
// be in relation to a specific channel.
157
157
let htlc_maximum_msat = u64:: max_value ( ) ;
@@ -170,11 +170,11 @@ impl BlindedPath {
170
170
///
171
171
/// [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
172
172
// TODO: make all payloads the same size with padding + add dummy hops
173
- pub fn new_for_payment < ES : EntropySource + ? Sized , T : secp256k1:: Signing + secp256k1:: Verification > (
173
+ pub fn new_for_payment < ES : Deref , T : secp256k1:: Signing + secp256k1:: Verification > (
174
174
intermediate_nodes : & [ payment:: ForwardNode ] , payee_node_id : PublicKey ,
175
175
payee_tlvs : payment:: ReceiveTlvs , htlc_maximum_msat : u64 , min_final_cltv_expiry_delta : u16 ,
176
- entropy_source : & ES , secp_ctx : & Secp256k1 < T >
177
- ) -> Result < ( BlindedPayInfo , Self ) , ( ) > {
176
+ entropy_source : ES , secp_ctx : & Secp256k1 < T >
177
+ ) -> Result < ( BlindedPayInfo , Self ) , ( ) > where ES :: Target : EntropySource {
178
178
let introduction_node = IntroductionNode :: NodeId (
179
179
intermediate_nodes. first ( ) . map_or ( payee_node_id, |n| n. node_id )
180
180
) ;
0 commit comments