@@ -84,7 +84,7 @@ method close*(session: QuicSession) {.async: (raises: []).} =
8484proc getStream * (
8585 session: QuicSession , direction = Direction .In
8686): Future [QuicStream ] {.async : (raises: [QuicTransportError ]).} =
87- try :
87+ try :
8888 var stream: Stream
8989 case direction
9090 of Direction .In :
@@ -156,7 +156,7 @@ func new*(_: type QuicTransport, u: Upgrade, privateKey: PrivateKey): QuicTransp
156156 return QuicTransport (
157157 upgrader: QuicUpgrade (ms: u.ms),
158158 privateKey: privateKey,
159- client: QuicClient .init (tlsConfig)
159+ client: QuicClient .init (tlsConfig),
160160 )
161161 except QuicConfigError as exc:
162162 doAssert false , " invalid quic setup: " & $ exc.msg
@@ -173,13 +173,10 @@ method start*(
173173 # TODO handle multiple addr
174174
175175 let pubkey = self.privateKey.getPublicKey ().valueOr:
176- doAssert false , " could not obtain public key"
177- return
176+ doAssert false , " could not obtain public key"
177+ return
178178
179- let keypair = KeyPair (
180- seckey: self.privateKey,
181- pubkey: pubkey
182- )
179+ let keypair = KeyPair (seckey: self.privateKey, pubkey: pubkey)
183180
184181 let certPair = generate (keypair, EncodingFormat .PEM )
185182
@@ -238,7 +235,9 @@ proc wrapConnection(
238235
239236method accept * (
240237 self: QuicTransport
241- ): Future [connection.Connection ] {.async : (raises: [transport.TransportError , CancelledError ]).} =
238+ ): Future [connection.Connection ] {.
239+ async : (raises: [transport.TransportError , CancelledError ])
240+ .} =
242241 doAssert not self.listener.isNil, " call start() before calling accept()"
243242 try :
244243 let connection = await self.listener.accept ()
@@ -253,10 +252,12 @@ method dial*(
253252 hostname: string ,
254253 address: MultiAddress ,
255254 peerId: Opt [PeerId ] = Opt .none (PeerId ),
256- ): Future [connection.Connection ] {.async : (raises: [transport.TransportError , CancelledError ]).} =
255+ ): Future [connection.Connection ] {.
256+ async : (raises: [transport.TransportError , CancelledError ])
257+ .} =
257258 try :
258259 let quicConnection = await self.client.dial (initTAddress (address).tryGet)
259- return await self.wrapConnection (quicConnection, Direction .In )
260+ return await self.wrapConnection (quicConnection, Direction .In )
260261 except CancelledError as e:
261262 raise e
262263 except CatchableError as e:
0 commit comments