@@ -18,7 +18,6 @@ use bitcoin::secp256k1::Secp256k1;
18
18
use bitcoin:: secp256k1;
19
19
use crate :: ln:: msgs:: DecodeError ;
20
20
use crate :: util:: ser:: Readable ;
21
- use bitcoin:: secp256k1:: constants:: PUBLIC_KEY_SIZE ;
22
21
use crate :: io;
23
22
use crate :: util:: ser:: Writer ;
24
23
use crate :: util:: ser:: Writeable ;
@@ -80,10 +79,6 @@ macro_rules! key_read_write {
80
79
fn write<W : Writer >( & self , w: & mut W ) -> Result <( ) , io:: Error > {
81
80
self . 0 . serialize( ) . write( w)
82
81
}
83
-
84
- fn serialized_length( & self ) -> usize {
85
- PUBLIC_KEY_SIZE
86
- }
87
82
}
88
83
89
84
impl Readable for $SelfT {
@@ -99,14 +94,14 @@ macro_rules! key_read_write {
99
94
100
95
/// Used to generate [`local_delayedpubkey`](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
101
96
#[ derive( PartialEq , Eq , Clone , Copy , Debug , Hash ) ]
102
- pub struct DelayedPaymentBasepoint ( PublicKey ) ;
97
+ pub struct DelayedPaymentBasepoint ( pub PublicKey ) ;
103
98
basepoint_impl ! ( DelayedPaymentBasepoint ) ;
104
99
key_read_write ! ( DelayedPaymentBasepoint ) ;
105
100
106
101
/// [delayedpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
107
102
/// Used to regenerate the scripts required for a penalty transaction or a spend from a force closed channel.
108
103
#[ derive( PartialEq , Eq , Clone , Copy , Debug ) ]
109
- pub struct DelayedPaymentKey ( PublicKey ) ;
104
+ pub struct DelayedPaymentKey ( pub PublicKey ) ;
110
105
111
106
impl DelayedPaymentKey {
112
107
key_impl ! ( DelayedPaymentBasepoint , "delayedpubkey" ) ;
@@ -115,15 +110,15 @@ key_read_write!(DelayedPaymentKey);
115
110
116
111
/// Used to generate [localpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
117
112
#[ derive( PartialEq , Eq , Clone , Copy , Debug , Hash ) ]
118
- pub struct PaymentBasepoint ( PublicKey ) ;
113
+ pub struct PaymentBasepoint ( pub PublicKey ) ;
119
114
basepoint_impl ! ( PaymentBasepoint ) ;
120
115
key_read_write ! ( PaymentBasepoint ) ;
121
116
122
117
123
118
/// [localpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
124
119
/// Used to generate commitment transaction's to_remote ouput.
125
120
#[ derive( PartialEq , Eq , Clone , Copy , Debug ) ]
126
- pub struct PaymentKey ( PublicKey ) ;
121
+ pub struct PaymentKey ( pub PublicKey ) ;
127
122
128
123
impl PaymentKey {
129
124
key_impl ! ( PaymentBasepoint , "localpubkey" ) ;
@@ -132,15 +127,15 @@ key_read_write!(PaymentKey);
132
127
133
128
/// Used to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
134
129
#[ derive( PartialEq , Eq , Clone , Copy , Debug , Hash ) ]
135
- pub struct HtlcBasepoint ( PublicKey ) ;
130
+ pub struct HtlcBasepoint ( pub PublicKey ) ;
136
131
basepoint_impl ! ( HtlcBasepoint ) ;
137
132
key_read_write ! ( HtlcBasepoint ) ;
138
133
139
134
140
135
/// [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
141
136
/// Used to generate HTLC outputs.
142
137
#[ derive( PartialEq , Eq , Clone , Copy , Debug ) ]
143
- pub struct HtlcKey ( PublicKey ) ;
138
+ pub struct HtlcKey ( pub PublicKey ) ;
144
139
145
140
impl HtlcKey {
146
141
key_impl ! ( HtlcBasepoint , "htlcpubkey" ) ;
@@ -164,15 +159,15 @@ fn derive_public_key<T: secp256k1::Signing>(secp_ctx: &Secp256k1<T>, per_commitm
164
159
165
160
/// Used to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
166
161
#[ derive( PartialEq , Eq , Clone , Copy , Debug , Hash ) ]
167
- pub struct RevocationBasepoint ( PublicKey ) ;
162
+ pub struct RevocationBasepoint ( pub PublicKey ) ;
168
163
basepoint_impl ! ( RevocationBasepoint ) ;
169
164
key_read_write ! ( RevocationBasepoint ) ;
170
165
171
166
172
167
/// [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
173
168
/// Used to generate HTLC outputs.
174
169
#[ derive( PartialEq , Eq , Clone , Copy , Debug , Hash ) ]
175
- pub struct RevocationKey ( PublicKey ) ;
170
+ pub struct RevocationKey ( pub PublicKey ) ;
176
171
177
172
impl RevocationKey {
178
173
/// Derives a per-commitment-transaction revocation public key from its constituent parts. This is
0 commit comments