File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -455,8 +455,8 @@ pub type SerialId = u64;
455
455
pub struct Stfu {
456
456
/// The channel ID where quiescence is intended
457
457
pub channel_id : ChannelId ,
458
- /// Initiator flag, 1 if initiating, 0 if replying to an stfu.
459
- pub initiator : u8 ,
458
+ /// Initiator flag, true if initiating, false if replying to an stfu.
459
+ pub initiator : bool ,
460
460
}
461
461
462
462
/// A `splice_init` message to be sent by or received from the stfu initiator (splice initiator).
@@ -4112,10 +4112,17 @@ mod tests {
4112
4112
fn encoding_stfu ( ) {
4113
4113
let stfu = msgs:: Stfu {
4114
4114
channel_id : ChannelId :: from_bytes ( [ 2 ; 32 ] ) ,
4115
- initiator : 1 ,
4115
+ initiator : true ,
4116
4116
} ;
4117
4117
let encoded_value = stfu. encode ( ) ;
4118
4118
assert_eq ! ( encoded_value. as_hex( ) . to_string( ) , "020202020202020202020202020202020202020202020202020202020202020201" ) ;
4119
+
4120
+ let stfu = msgs:: Stfu {
4121
+ channel_id : ChannelId :: from_bytes ( [ 3 ; 32 ] ) ,
4122
+ initiator : false ,
4123
+ } ;
4124
+ let encoded_value = stfu. encode ( ) ;
4125
+ assert_eq ! ( encoded_value. as_hex( ) . to_string( ) , "030303030303030303030303030303030303030303030303030303030303030300" ) ;
4119
4126
}
4120
4127
4121
4128
#[ test]
You can’t perform that action at this time.
0 commit comments