@@ -222,17 +222,19 @@ where
222
222
}
223
223
} ;
224
224
225
- #[ allow( deprecated) ]
226
225
gs. on_swarm_event ( FromSwarm :: ConnectionEstablished ( ConnectionEstablished {
227
226
peer_id : peer,
228
- connection_id : ConnectionId :: DUMMY ,
227
+ connection_id : ConnectionId :: new_unchecked ( 0 ) ,
229
228
endpoint : & endpoint,
230
229
failed_addresses : & [ ] ,
231
230
other_established : 0 , // first connection
232
231
} ) ) ;
233
232
if let Some ( kind) = kind {
234
- #[ allow( deprecated) ]
235
- gs. on_connection_handler_event ( peer, ConnectionId :: DUMMY , HandlerEvent :: PeerKind ( kind) ) ;
233
+ gs. on_connection_handler_event (
234
+ peer,
235
+ ConnectionId :: new_unchecked ( 0 ) ,
236
+ HandlerEvent :: PeerKind ( kind) ,
237
+ ) ;
236
238
}
237
239
if explicit {
238
240
gs. add_explicit_peer ( & peer) ;
@@ -582,10 +584,9 @@ fn test_join() {
582
584
for _ in 0 ..3 {
583
585
let random_peer = PeerId :: random ( ) ;
584
586
// inform the behaviour of a new peer
585
- #[ allow( deprecated) ]
586
587
gs. on_swarm_event ( FromSwarm :: ConnectionEstablished ( ConnectionEstablished {
587
588
peer_id : random_peer,
588
- connection_id : ConnectionId :: DUMMY ,
589
+ connection_id : ConnectionId :: new_unchecked ( 0 ) ,
589
590
endpoint : & ConnectedPoint :: Dialer {
590
591
address : "/ip4/127.0.0.1" . parse :: < Multiaddr > ( ) . unwrap ( ) ,
591
592
role_override : Endpoint :: Dialer ,
@@ -965,10 +966,7 @@ fn test_get_random_peers() {
965
966
* p,
966
967
PeerConnections {
967
968
kind : PeerKind :: Gossipsubv1_1 ,
968
- connections : vec ! [
969
- #[ allow( deprecated) ]
970
- ConnectionId :: DUMMY ,
971
- ] ,
969
+ connections : vec ! [ ConnectionId :: new_unchecked( 0 ) ] ,
972
970
} ,
973
971
)
974
972
} )
@@ -2998,8 +2996,7 @@ fn test_ignore_rpc_from_peers_below_graylist_threshold() {
2998
2996
//receive from p1
2999
2997
gs. on_connection_handler_event (
3000
2998
p1,
3001
- #[ allow( deprecated) ]
3002
- ConnectionId :: DUMMY ,
2999
+ ConnectionId :: new_unchecked ( 0 ) ,
3003
3000
HandlerEvent :: Message {
3004
3001
rpc : Rpc {
3005
3002
messages : vec ! [ raw_message1] ,
@@ -3025,8 +3022,7 @@ fn test_ignore_rpc_from_peers_below_graylist_threshold() {
3025
3022
//receive from p2
3026
3023
gs. on_connection_handler_event (
3027
3024
p2,
3028
- #[ allow( deprecated) ]
3029
- ConnectionId :: DUMMY ,
3025
+ ConnectionId :: new_unchecked ( 0 ) ,
3030
3026
HandlerEvent :: Message {
3031
3027
rpc : Rpc {
3032
3028
messages : vec ! [ raw_message3] ,
@@ -3632,8 +3628,7 @@ fn test_scoring_p4_invalid_signature() {
3632
3628
3633
3629
gs. on_connection_handler_event (
3634
3630
peers[ 0 ] ,
3635
- #[ allow( deprecated) ]
3636
- ConnectionId :: DUMMY ,
3631
+ ConnectionId :: new_unchecked ( 0 ) ,
3637
3632
HandlerEvent :: Message {
3638
3633
rpc : Rpc {
3639
3634
messages : vec ! [ ] ,
@@ -4114,11 +4109,10 @@ fn test_scoring_p6() {
4114
4109
}
4115
4110
4116
4111
//add additional connection for 3 others with addr
4117
- #[ allow( deprecated) ]
4118
4112
for id in others. iter ( ) . take ( 3 ) {
4119
4113
gs. on_swarm_event ( FromSwarm :: ConnectionEstablished ( ConnectionEstablished {
4120
4114
peer_id : * id,
4121
- connection_id : ConnectionId :: DUMMY ,
4115
+ connection_id : ConnectionId :: new_unchecked ( 0 ) ,
4122
4116
endpoint : & ConnectedPoint :: Dialer {
4123
4117
address : addr. clone ( ) ,
4124
4118
role_override : Endpoint :: Dialer ,
@@ -4137,10 +4131,9 @@ fn test_scoring_p6() {
4137
4131
4138
4132
//add additional connection for 3 of the peers to addr2
4139
4133
for peer in peers. iter ( ) . take ( 3 ) {
4140
- #[ allow( deprecated) ]
4141
4134
gs. on_swarm_event ( FromSwarm :: ConnectionEstablished ( ConnectionEstablished {
4142
4135
peer_id : * peer,
4143
- connection_id : ConnectionId :: DUMMY ,
4136
+ connection_id : ConnectionId :: new_unchecked ( 0 ) ,
4144
4137
endpoint : & ConnectedPoint :: Dialer {
4145
4138
address : addr2. clone ( ) ,
4146
4139
role_override : Endpoint :: Dialer ,
@@ -4168,10 +4161,9 @@ fn test_scoring_p6() {
4168
4161
) ;
4169
4162
4170
4163
//two times same ip doesn't count twice
4171
- #[ allow( deprecated) ]
4172
4164
gs. on_swarm_event ( FromSwarm :: ConnectionEstablished ( ConnectionEstablished {
4173
4165
peer_id : peers[ 0 ] ,
4174
- connection_id : ConnectionId :: DUMMY ,
4166
+ connection_id : ConnectionId :: new_unchecked ( 0 ) ,
4175
4167
endpoint : & ConnectedPoint :: Dialer {
4176
4168
address : addr,
4177
4169
role_override : Endpoint :: Dialer ,
@@ -5179,8 +5171,7 @@ fn test_subscribe_and_graft_with_negative_score() {
5179
5171
5180
5172
let ( mut gs2, _, _) = inject_nodes1 ( ) . create_network ( ) ;
5181
5173
5182
- #[ allow( deprecated) ]
5183
- let connection_id = ConnectionId :: DUMMY ;
5174
+ let connection_id = ConnectionId :: new_unchecked ( 0 ) ;
5184
5175
5185
5176
let topic = Topic :: new ( "test" ) ;
5186
5177
0 commit comments