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;
455455pub struct Stfu {
456456 /// The channel ID where quiescence is intended
457457 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 ,
460460}
461461
462462/// A `splice_init` message to be sent by or received from the stfu initiator (splice initiator).
@@ -4112,10 +4112,17 @@ mod tests {
41124112 fn encoding_stfu ( ) {
41134113 let stfu = msgs:: Stfu {
41144114 channel_id : ChannelId :: from_bytes ( [ 2 ; 32 ] ) ,
4115- initiator : 1 ,
4115+ initiator : true ,
41164116 } ;
41174117 let encoded_value = stfu. encode ( ) ;
41184118 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" ) ;
41194126 }
41204127
41214128 #[ test]
You can’t perform that action at this time.
0 commit comments