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

safe-global / safe-client-gateway / 11515358830

25 Oct 2024 09:12AM UTC coverage: 88.944% (-1.3%) from 90.269%
11515358830

push

github

hectorgomezv
Remove FF_EVENTS_QUEUE

2597 of 3278 branches covered (79.23%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 2 files covered. (100.0%)

87 existing lines in 12 files now uncovered.

8875 of 9620 relevant lines covered (92.26%)

397.5 hits per line

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

83.87
/src/datasources/staking-api/staking-api.manager.ts
1
import { IConfigurationService } from '@/config/configuration.service.interface';
112✔
2
import { CacheFirstDataSource } from '@/datasources/cache/cache.first.data.source';
112✔
3
import {
112✔
4
  CacheService,
5
  ICacheService,
6
} from '@/datasources/cache/cache.service.interface';
7
import { HttpErrorFactory } from '@/datasources/errors/http-error-factory';
112✔
8
import { KilnApi } from '@/datasources/staking-api/kiln-api.service';
112✔
9
import { IConfigApi } from '@/domain/interfaces/config-api.interface';
112✔
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';
112✔
13

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

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

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

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

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

42
    this.apis[chainId] = new KilnApi(
100✔
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]);
100✔
53
  }
54

55
  destroyApi(chainId: string): void {
56
    if (this.apis[chainId] !== undefined) {
2!
UNCOV
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