@@ -46,7 +46,7 @@ use crate::util::ser::{LengthReadable, Readable, ReadableArgs, Writeable, Writer
46
46
47
47
use crate :: ln:: { PaymentPreimage , PaymentHash , PaymentSecret } ;
48
48
49
- use crate :: routing:: gossip:: NodeId ;
49
+ use crate :: routing:: gossip:: { NodeAlias , NodeId } ;
50
50
51
51
/// 21 million * 10^8 * 1000
52
52
pub ( crate ) const MAX_VALUE_MSAT : u64 = 21_000_000_0000_0000_000 ;
@@ -694,7 +694,7 @@ pub struct UnsignedNodeAnnouncement {
694
694
/// An alias, for UI purposes.
695
695
///
696
696
/// This should be sanitized before use. There is no guarantee of uniqueness.
697
- pub alias : [ u8 ; 32 ] ,
697
+ pub alias : NodeAlias ,
698
698
/// List of addresses on which this node is reachable
699
699
pub addresses : Vec < NetAddress > ,
700
700
pub ( crate ) excess_address_data : Vec < u8 > ,
@@ -1931,7 +1931,7 @@ impl Readable for UnsignedNodeAnnouncement {
1931
1931
let node_id: NodeId = Readable :: read ( r) ?;
1932
1932
let mut rgb = [ 0 ; 3 ] ;
1933
1933
r. read_exact ( & mut rgb) ?;
1934
- let alias: [ u8 ; 32 ] = Readable :: read ( r) ?;
1934
+ let alias: NodeAlias = Readable :: read ( r) ?;
1935
1935
1936
1936
let addr_len: u16 = Readable :: read ( r) ?;
1937
1937
let mut addresses: Vec < NetAddress > = Vec :: new ( ) ;
@@ -2138,7 +2138,7 @@ mod tests {
2138
2138
use crate :: ln:: features:: { ChannelFeatures , ChannelTypeFeatures , InitFeatures , NodeFeatures } ;
2139
2139
use crate :: ln:: msgs;
2140
2140
use crate :: ln:: msgs:: { FinalOnionHopData , OptionalField , OnionErrorPacket , OnionHopDataFormat } ;
2141
- use crate :: routing:: gossip:: NodeId ;
2141
+ use crate :: routing:: gossip:: { NodeAlias , NodeId } ;
2142
2142
use crate :: util:: ser:: { Writeable , Readable , Hostname } ;
2143
2143
2144
2144
use bitcoin:: hashes:: hex:: FromHex ;
@@ -2333,7 +2333,7 @@ mod tests {
2333
2333
timestamp : 20190119 ,
2334
2334
node_id : NodeId :: from_pubkey ( & pubkey_1) ,
2335
2335
rgb : [ 32 ; 3 ] ,
2336
- alias : [ 16 ; 32 ] ,
2336
+ alias : NodeAlias ( [ 16 ; 32 ] ) ,
2337
2337
addresses,
2338
2338
excess_address_data : if excess_address_data { vec ! [ 33 , 108 , 40 , 11 , 83 , 149 , 162 , 84 , 110 , 126 , 75 , 38 , 99 , 224 , 79 , 129 , 22 , 34 , 241 , 90 , 79 , 146 , 232 , 58 , 162 , 233 , 43 , 162 , 165 , 115 , 193 , 57 , 20 , 44 , 84 , 174 , 99 , 7 , 42 , 30 , 193 , 238 , 125 , 192 , 192 , 75 , 222 , 92 , 132 , 120 , 6 , 23 , 42 , 160 , 92 , 146 , 194 , 42 , 232 , 227 , 8 , 209 , 210 , 105 ] } else { Vec :: new ( ) } ,
2339
2339
excess_data : if excess_data { vec ! [ 59 , 18 , 204 , 25 , 92 , 224 , 162 , 209 , 189 , 166 , 168 , 139 , 239 , 161 , 159 , 160 , 127 , 81 , 202 , 167 , 92 , 232 , 56 , 55 , 242 , 137 , 101 , 96 , 11 , 138 , 172 , 171 , 8 , 85 , 255 , 176 , 231 , 65 , 236 , 95 , 124 , 65 , 66 , 30 , 152 , 41 , 169 , 212 , 134 , 17 , 200 , 200 , 49 , 247 , 27 , 229 , 234 , 115 , 230 , 101 , 148 , 151 , 127 , 253 ] } else { Vec :: new ( ) } ,
0 commit comments