File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
pallets/node-authorization/src Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ pub mod pallet {
150150 }
151151
152152 #[ pallet:: error]
153+ #[ derive( PartialEq ) ]
153154 pub enum Error < T > {
154155 /// The Node identifier is too long.
155156 NodeIdTooLong ,
Original file line number Diff line number Diff line change 2222
2323use super :: * ;
2424use crate :: mock:: * ;
25- use frame_support:: { assert_noop, assert_ok} ;
25+ use frame_support:: { assert_err , assert_noop, assert_ok} ;
2626use sp_runtime:: traits:: BadOrigin ;
2727
2828#[ test]
@@ -453,3 +453,9 @@ fn adding_already_connected_connection_should_fail() {
453453 ) ;
454454 } ) ;
455455}
456+
457+ #[ test]
458+ fn test_generate_peer_id_invalid_utf8 ( ) {
459+ let invalid_node_id: NodeId = vec ! [ 0xFF , 0xFE , 0xFD ] ;
460+ assert_err ! ( NodeAuthorization :: generate_peer_id( & invalid_node_id) , Error :: <Test >:: InvalidUtf8 ) ;
461+ }
You can’t perform that action at this time.
0 commit comments