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

safe-global / safe-client-gateway / 13034755489

29 Jan 2025 03:32PM UTC coverage: 90.742% (-0.3%) from 91.028%
13034755489

Pull #2313

github

web-flow
Merge ef803f751 into a6bc54987
Pull Request #2313: Add datasource for Safe Decoder Service

1712 of 2068 branches covered (82.79%)

Branch coverage included in aggregate %.

43 of 90 new or added lines in 11 files covered. (47.78%)

5894 of 6314 relevant lines covered (93.35%)

832.16 hits per line

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

0.0
/src/datasources/data-decoder-api/data-decoder-api.manager.ts
NEW
1
import { Inject, Injectable } from '@nestjs/common';
×
NEW
2
import { IConfigurationService } from '@/config/configuration.service.interface';
×
NEW
3
import { DataDecoderApi } from '@/datasources/data-decoder-api/data-decoder-api.service';
×
NEW
4
import { HttpErrorFactory } from '@/datasources/errors/http-error-factory';
×
NEW
5
import {
×
6
  NetworkService,
7
  INetworkService,
8
} from '@/datasources/network/network.service.interface';
9
import { IDataDecoderApiManager } from '@/domain/interfaces/data-decoder-api.manager.interface';
10

11
@Injectable()
NEW
12
export class DataDecoderApiManager implements IDataDecoderApiManager {
×
NEW
13
  private decoderApiMap: Record<string, DataDecoderApi> = {};
×
14

15
  private readonly baseUri: string;
16

17
  constructor(
18
    @Inject(IConfigurationService)
NEW
19
    private readonly configurationService: IConfigurationService,
×
NEW
20
    private readonly httpErrorFactory: HttpErrorFactory,
×
21
    @Inject(NetworkService)
NEW
22
    private readonly networkService: INetworkService,
×
23
  ) {
NEW
24
    this.baseUri = this.configurationService.getOrThrow<string>(
×
25
      'safeDataDecoder.baseUri',
26
    );
27
  }
28

29
  async getApi(chainId: string): Promise<DataDecoderApi> {
NEW
30
    const decoderApi = this.decoderApiMap[chainId];
×
31

NEW
32
    if (decoderApi !== undefined) {
×
NEW
33
      return Promise.resolve(decoderApi);
×
34
    }
35

NEW
36
    this.decoderApiMap[chainId] = new DataDecoderApi(
×
37
      chainId,
38
      this.baseUri,
39
      this.networkService,
40
      this.httpErrorFactory,
41
    );
42

NEW
43
    return Promise.resolve(this.decoderApiMap[chainId]);
×
44
  }
45

46
  // We don't need to destroy the API as it is not event-specific
47
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
48
  destroyApi(_: string): void {
NEW
49
    throw new Error('Method not implemented');
×
50
  }
51
}
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