@@ -147,7 +147,7 @@ impl chain::Watch<EnforcingSigner> for TestChainMonitor {
147
147
148
148
struct KeyProvider {
149
149
node_id : u8 ,
150
- rand_bytes_id : atomic:: AtomicU8 ,
150
+ rand_bytes_id : atomic:: AtomicU32 ,
151
151
revoked_commitments : Mutex < HashMap < [ u8 ; 32 ] , Arc < Mutex < u64 > > > > ,
152
152
}
153
153
impl KeysInterface for KeyProvider {
@@ -179,7 +179,7 @@ impl KeysInterface for KeyProvider {
179
179
SecretKey :: from_slice ( & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , self . node_id ] ) . unwrap ( ) ,
180
180
SecretKey :: from_slice ( & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , self . node_id ] ) . unwrap ( ) ,
181
181
SecretKey :: from_slice ( & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 8 , self . node_id ] ) . unwrap ( ) ,
182
- [ id, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , self . node_id ] ,
182
+ [ id as u8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , self . node_id ] ,
183
183
channel_value_satoshis,
184
184
[ 0 ; 32 ] ,
185
185
) ;
@@ -189,7 +189,9 @@ impl KeysInterface for KeyProvider {
189
189
190
190
fn get_secure_random_bytes ( & self ) -> [ u8 ; 32 ] {
191
191
let id = self . rand_bytes_id . fetch_add ( 1 , atomic:: Ordering :: Relaxed ) ;
192
- [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , id, 11 , self . node_id ]
192
+ let mut res = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 11 , self . node_id ] ;
193
+ res[ 30 -4 ..30 ] . copy_from_slice ( & id. to_le_bytes ( ) ) ;
194
+ res
193
195
}
194
196
195
197
fn read_chan_signer ( & self , buffer : & [ u8 ] ) -> Result < Self :: Signer , DecodeError > {
@@ -334,7 +336,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
334
336
let logger: Arc <dyn Logger > = Arc :: new( test_logger:: TestLogger :: new( $node_id. to_string( ) , out. clone( ) ) ) ;
335
337
let monitor = Arc :: new( TestChainMonitor :: new( broadcast. clone( ) , logger. clone( ) , fee_est. clone( ) , Arc :: new( TestPersister { } ) ) ) ;
336
338
337
- let keys_manager = Arc :: new( KeyProvider { node_id: $node_id, rand_bytes_id: atomic:: AtomicU8 :: new( 0 ) , revoked_commitments: Mutex :: new( HashMap :: new( ) ) } ) ;
339
+ let keys_manager = Arc :: new( KeyProvider { node_id: $node_id, rand_bytes_id: atomic:: AtomicU32 :: new( 0 ) , revoked_commitments: Mutex :: new( HashMap :: new( ) ) } ) ;
338
340
let mut config = UserConfig :: default ( ) ;
339
341
config. channel_options. fee_proportional_millionths = 0 ;
340
342
config. channel_options. announced_channel = true ;
0 commit comments