Commit dd72039
committed
refactor: use handle pattern for Kyoto client
Refactor KyotoClient to use a KyotoClientHandle struct instead of
Box<LightClient>. Previously, the Box<LightClient> was consumed
when destructured in sync_kyoto_client, preventing the function
from being called multiple times or borrowed. With the handle
pattern, sync_kyoto_client now takes &mut KyotoClientHandle,
allowing it to be borrowed and reused.
This also allows the node to be started at creation time in
new_blockchain_client rather than during sync, making the client
ready for use immediately after creation.
- Add KyotoClientHandle struct containing requester and
update_subscriber
- Move node startup and logger spawning to new_blockchain_client
- Update sync_kyoto_client to accept &mut KyotoClientHandle
instead of consuming Box<LightClient>1 parent fb7f6c6 commit dd72039
1 file changed
+36
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
| |||
216 | 224 | | |
217 | 225 | | |
218 | 226 | | |
219 | | - | |
| 227 | + | |
220 | 228 | | |
221 | 229 | | |
222 | 230 | | |
223 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
224 | 248 | | |
225 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
226 | 253 | | |
227 | 254 | | |
228 | 255 | | |
| |||
334 | 361 | | |
335 | 362 | | |
336 | 363 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
354 | 369 | | |
355 | 370 | | |
356 | 371 | | |
357 | 372 | | |
358 | 373 | | |
359 | | - | |
| 374 | + | |
360 | 375 | | |
361 | 376 | | |
362 | 377 | | |
| |||
0 commit comments