• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 11233174198

08 Oct 2024 10:05AM UTC coverage: 46.725% (-44.0%) from 90.725%
11233174198

push

github

web-flow
Increase relay rate limit TTL (#1971)

Increases the relay rate limit TTL fallback value to 24 hours:

- Change `relay.ttlSeconds` value to `60 * 60 * 24`

498 of 3105 branches covered (16.04%)

Branch coverage included in aggregate %.

5024 of 8713 relevant lines covered (57.66%)

12.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

67.74
/src/datasources/staking-api/staking-api.manager.ts
1
import { IConfigurationService } from '@/config/configuration.service.interface';
16✔
2
import { CacheFirstDataSource } from '@/datasources/cache/cache.first.data.source';
16✔
3
import {
16✔
4
  CacheService,
5
  ICacheService,
6
} from '@/datasources/cache/cache.service.interface';
7
import { HttpErrorFactory } from '@/datasources/errors/http-error-factory';
16✔
8
import { KilnApi } from '@/datasources/staking-api/kiln-api.service';
16✔
9
import { IConfigApi } from '@/domain/interfaces/config-api.interface';
16✔
10
import { IStakingApi } from '@/domain/interfaces/staking-api.interface';
11
import { IStakingApiManager } from '@/domain/interfaces/staking-api.manager.interface';
12
import { Inject, Injectable } from '@nestjs/common';
16✔
13

14
@Injectable()
15
export class StakingApiManager implements IStakingApiManager {
16✔
16
  private readonly apis: Record<string, IStakingApi> = {};
16✔
17

18
  constructor(
19
    private readonly dataSource: CacheFirstDataSource,
16✔
20
    @Inject(IConfigurationService)
21
    private readonly configurationService: IConfigurationService,
16✔
22
    @Inject(IConfigApi) private readonly configApi: IConfigApi,
16✔
23
    private readonly httpErrorFactory: HttpErrorFactory,
16✔
24
    @Inject(CacheService)
25
    private readonly cacheService: ICacheService,
16✔
26
  ) {}
27

28
  async getApi(chainId: string): Promise<IStakingApi> {
29
    if (this.apis[chainId]) {
18!
30
      return Promise.resolve(this.apis[chainId]);
×
31
    }
32

33
    const chain = await this.configApi.getChain(chainId);
18✔
34

35
    const baseUrl = this.configurationService.getOrThrow<string>(
18✔
36
      chain.isTestnet ? 'staking.testnet.baseUri' : 'staking.mainnet.baseUri',
9!
37
    );
38
    const apiKey = this.configurationService.getOrThrow<string>(
18✔
39
      chain.isTestnet ? 'staking.testnet.apiKey' : 'staking.mainnet.apiKey',
9!
40
    );
41

42
    this.apis[chainId] = new KilnApi(
×
43
      baseUrl,
44
      apiKey,
45
      this.dataSource,
46
      this.httpErrorFactory,
47
      this.configurationService,
48
      this.cacheService,
49
      chain.chainId,
50
    );
51

52
    return Promise.resolve(this.apis[chainId]);
×
53
  }
54

55
  destroyApi(chainId: string): void {
56
    if (this.apis[chainId] !== undefined) {
2!
57
      delete this.apis[chainId];
×
58
    }
59
  }
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc