File tree Expand file tree Collapse file tree 3 files changed +254
-241
lines changed Expand file tree Collapse file tree 3 files changed +254
-241
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,15 @@ extern crate lightning;
5
5
6
6
use lightning:: ln:: channelmonitor;
7
7
use lightning:: util:: reset_rng_state;
8
+ use lightning:: util:: ser:: Readable ;
9
+
10
+ use std:: io:: Cursor ;
8
11
9
12
#[ inline]
10
13
pub fn do_test ( data : & [ u8 ] ) {
11
14
reset_rng_state ( ) ;
12
- if let Some ( monitor) = channelmonitor:: ChannelMonitor :: deserialize ( data) {
13
- assert ! ( channelmonitor:: ChannelMonitor :: deserialize ( & monitor. serialize_for_disk( ) [ ..] ) . unwrap( ) == monitor) ;
15
+ if let Ok ( monitor) = channelmonitor:: ChannelMonitor :: read ( & mut Cursor :: new ( data) ) {
16
+ assert ! ( channelmonitor:: ChannelMonitor :: read ( & mut Cursor :: new ( & monitor. serialize_for_disk( ) [ ..] ) ) . unwrap( ) == monitor) ;
14
17
monitor. serialize_for_watchtower ( ) ;
15
18
}
16
19
}
You can’t perform that action at this time.
0 commit comments