Skip to content

Commit b56a8bb

Browse files
committed
demo: call sync() early
1 parent 74841ed commit b56a8bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

TonLibDotNet.Demo/SamplesRunner.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ namespace TonLibDotNet
66
public class SamplesRunner : IHostedService
77
{
88
private readonly IServiceProvider services;
9+
private readonly ITonClient tonClient;
910

10-
public SamplesRunner(IServiceProvider services)
11+
public SamplesRunner(IServiceProvider services, ITonClient tonClient)
1112
{
1213
this.services = services;
14+
this.tonClient = tonClient;
1315
}
1416

1517
public async Task StartAsync(CancellationToken cancellationToken)
1618
{
17-
await services.GetRequiredService<ITonClient>().InitIfNeeded();
19+
await tonClient.InitIfNeeded();
20+
await tonClient.Sync();
1821

1922
var samples = services.GetServices(typeof(ISample)).Cast<ISample>().OrderBy(x => x.GetType().Name).ToList();
2023

0 commit comments

Comments
 (0)