Skip to content

Commit 7bf30bc

Browse files
committed
Retry 502 error in LS retrier + updated ton ls configs
1 parent 18df391 commit 7bf30bc

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

adnl/dht/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func TestClient_FindAddressesIntegration(t *testing.T) {
423423
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
424424
defer cancel()
425425

426-
dhtClient, err := NewClientFromConfigUrl(ctx, gateway, "https://tonutils.com/global.config.json")
426+
dhtClient, err := NewClientFromConfigUrl(ctx, gateway, "https://ton-blockchain.github.io/global.config.json")
427427
if err != nil {
428428
t.Fatalf("failed to init DHT client: %s", err.Error())
429429
}
@@ -486,7 +486,7 @@ func TestClient_StoreAddressIntegration(t *testing.T) {
486486
ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second)
487487
defer cancel()
488488

489-
dhtClient, err := NewClientFromConfigUrl(ctx, gateway, "https://tonutils.com/global.config.json")
489+
dhtClient, err := NewClientFromConfigUrl(ctx, gateway, "https://ton-blockchain.github.io/global.config.json")
490490
if err != nil {
491491
t.Fatalf("failed to init DHT client: %s", err.Error())
492492
}

liteclient/integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func Test_Conn(t *testing.T) {
4040
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
4141
defer cancel()
4242

43-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/global.config.json")
43+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/global.config.json")
4444
if err != nil {
4545
t.Fatal("add connections err", err)
4646
}
@@ -90,7 +90,7 @@ func Test_ConnSticky(t *testing.T) {
9090
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
9191
defer cancel()
9292

93-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/global.config.json")
93+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/global.config.json")
9494
if err != nil {
9595
t.Fatal("add connections err", err)
9696
}
@@ -129,7 +129,7 @@ func Test_ConnSticky(t *testing.T) {
129129
func Test_ServerProxy(t *testing.T) {
130130
client := NewConnectionPool()
131131

132-
err := client.AddConnectionsFromConfigUrl(context.Background(), "https://tonutils.com/global.config.json")
132+
err := client.AddConnectionsFromConfigUrl(context.Background(), "https://ton-blockchain.github.io/global.config.json")
133133
if err != nil {
134134
t.Fatal("add connections err", err)
135135
}

ton/dns/integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ var api = func() ton.APIClientWrapped {
1414
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
1515
defer cancel()
1616

17-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/global.config.json")
17+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/global.config.json")
1818
if err != nil {
1919
panic(err)
2020
}
2121

22-
return ton.NewAPIClient(client).WithRetry()
22+
return ton.NewAPIClient(client).WithTimeout(5 * time.Second).WithRetry()
2323
}()
2424

2525
func TestDNSClient_Resolve(t *testing.T) {
26-
root, err := RootContractAddr(api)
26+
root, err := GetRootContractAddr(context.Background(), api)
2727
if err != nil {
2828
t.Fatal(err)
2929
}

ton/integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var apiTestNet = func() APIClientWrapped {
2424
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
2525
defer cancel()
2626

27-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/testnet-global.config.json")
27+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/testnet-global.config.json")
2828
if err != nil {
2929
panic(err)
3030
}
@@ -38,7 +38,7 @@ var api = func() APIClientWrapped {
3838
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
3939
defer cancel()
4040

41-
cfg, err := liteclient.GetConfigFromUrl(ctx, "https://tonutils.com/global.config.json")
41+
cfg, err := liteclient.GetConfigFromUrl(ctx, "https://ton-blockchain.github.io/global.config.json")
4242
if err != nil {
4343
panic(err)
4444
}
@@ -624,7 +624,7 @@ func TestAccountStorage_LoadFromCell_ExtraCurrencies(t *testing.T) {
624624
}
625625

626626
func TestAPIClient_GetBlockProofForward(t *testing.T) {
627-
cfg, err := liteclient.GetConfigFromUrl(context.Background(), "https://tonutils.com/global.config.json")
627+
cfg, err := liteclient.GetConfigFromUrl(context.Background(), "https://ton-blockchain.github.io/global.config.json")
628628
if err != nil {
629629
t.Fatal("get cfg err:", err.Error())
630630
return

ton/jetton/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var api = func() ton.APIClientWrapped {
2121
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
2222
defer cancel()
2323

24-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/testnet-global.config.json")
24+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/testnet-global.config.json")
2525
if err != nil {
2626
panic(err)
2727
}

ton/nft/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var api = func() ton.APIClientWrapped {
2525
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
2626
defer cancel()
2727

28-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/testnet-global.config.json")
28+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/testnet-global.config.json")
2929
if err != nil {
3030
panic(err)
3131
}

ton/payments/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var api = func() ton.APIClientWrapped {
2323
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
2424
defer cancel()
2525

26-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/testnet-global.config.json")
26+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/testnet-global.config.json")
2727
if err != nil {
2828
panic(err)
2929
}

ton/retrier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func (w *retryClient) QueryLiteserver(ctx context.Context, payload tl.Serializab
6060
lsErr.Code == 652 ||
6161
lsErr.Code == -400 ||
6262
lsErr.Code == -503 ||
63+
lsErr.Code == 502 ||
6364
(lsErr.Code == 0 && strings.Contains(lsErr.Text, "Failed to get account state"))) {
64-
6565
if ctx, err = w.original.StickyContextNextNode(ctx); err != nil { // try next node
6666
rounds++
6767
if rounds < maxRounds {

ton/wallet/integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var api = func() ton.APIClientWrapped {
2929
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
3030
defer cancel()
3131

32-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/testnet-global.config.json")
32+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/testnet-global.config.json")
3333
if err != nil {
3434
panic(err)
3535
}
@@ -43,7 +43,7 @@ var apiMain = func() ton.APIClientWrapped {
4343
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
4444
defer cancel()
4545

46-
err := client.AddConnectionsFromConfigUrl(ctx, "https://tonutils.com/global.config.json")
46+
err := client.AddConnectionsFromConfigUrl(ctx, "https://ton-blockchain.github.io/global.config.json")
4747
if err != nil {
4848
panic(err)
4949
}

0 commit comments

Comments
 (0)