Commit 33a3b9d 1 parent 9947727 commit 33a3b9d Copy full SHA for 33a3b9d
File tree 4 files changed +36
-12
lines changed
4 files changed +36
-12
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,15 @@ impl Default for FaucetConfig {
57
57
#[ cfg( test) ]
58
58
mod tests {
59
59
use super :: FaucetConfig ;
60
+ use tokio:: net:: TcpListener ;
60
61
61
- #[ test]
62
- fn default_faucet_config ( ) {
63
- let _config = FaucetConfig :: default ( ) ;
62
+ #[ tokio:: test]
63
+ async fn default_faucet_config ( ) {
64
+ // Default does not panic
65
+ let config = FaucetConfig :: default ( ) ;
66
+ // Default can bind
67
+ let socket_addrs = config. endpoint . socket_addrs ( || None ) . unwrap ( ) ;
68
+ let socket_addr = socket_addrs. into_iter ( ) . next ( ) . unwrap ( ) ;
69
+ let _listener = TcpListener :: bind ( socket_addr) . await . unwrap ( ) ;
64
70
}
65
71
}
Original file line number Diff line number Diff line change @@ -51,9 +51,15 @@ impl Default for BlockProducerConfig {
51
51
#[ cfg( test) ]
52
52
mod tests {
53
53
use super :: BlockProducerConfig ;
54
+ use tokio:: net:: TcpListener ;
54
55
55
- #[ test]
56
- fn default_block_producer_config ( ) {
57
- let _config = BlockProducerConfig :: default ( ) ;
56
+ #[ tokio:: test]
57
+ async fn default_block_producer_config ( ) {
58
+ // Default does not panic
59
+ let config = BlockProducerConfig :: default ( ) ;
60
+ // Default can bind
61
+ let socket_addrs = config. endpoint . socket_addrs ( || None ) . unwrap ( ) ;
62
+ let socket_addr = socket_addrs. into_iter ( ) . next ( ) . unwrap ( ) ;
63
+ let _listener = TcpListener :: bind ( socket_addr) . await . unwrap ( ) ;
58
64
}
59
65
}
Original file line number Diff line number Diff line change @@ -52,9 +52,15 @@ impl Default for RpcConfig {
52
52
#[ cfg( test) ]
53
53
mod tests {
54
54
use super :: RpcConfig ;
55
+ use tokio:: net:: TcpListener ;
55
56
56
- #[ test]
57
- fn default_rpc_config ( ) {
58
- let _config = RpcConfig :: default ( ) ;
57
+ #[ tokio:: test]
58
+ async fn default_rpc_config ( ) {
59
+ // Default does not panic
60
+ let config = RpcConfig :: default ( ) ;
61
+ // Default can bind
62
+ let socket_addrs = config. endpoint . socket_addrs ( || None ) . unwrap ( ) ;
63
+ let socket_addr = socket_addrs. into_iter ( ) . next ( ) . unwrap ( ) ;
64
+ let _listener = TcpListener :: bind ( socket_addr) . await . unwrap ( ) ;
59
65
}
60
66
}
Original file line number Diff line number Diff line change @@ -48,9 +48,15 @@ impl Default for StoreConfig {
48
48
#[ cfg( test) ]
49
49
mod tests {
50
50
use super :: StoreConfig ;
51
+ use tokio:: net:: TcpListener ;
51
52
52
- #[ test]
53
- fn default_store_config ( ) {
54
- let _config = StoreConfig :: default ( ) ;
53
+ #[ tokio:: test]
54
+ async fn default_store_config ( ) {
55
+ // Default does not panic
56
+ let config = StoreConfig :: default ( ) ;
57
+ // Default can bind
58
+ let socket_addrs = config. endpoint . socket_addrs ( || None ) . unwrap ( ) ;
59
+ let socket_addr = socket_addrs. into_iter ( ) . next ( ) . unwrap ( ) ;
60
+ let _listener = TcpListener :: bind ( socket_addr) . await . unwrap ( ) ;
55
61
}
56
62
}
You can’t perform that action at this time.
0 commit comments