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

safe-global / safe-client-gateway / 8630594257

10 Apr 2024 11:38AM UTC coverage: 45.232% (-47.6%) from 92.862%
8630594257

Pull #1369

github

iamacook
Only store signer address in JWT payload
Pull Request #1369: Add `AuthGuard`

293 of 2225 branches covered (13.17%)

Branch coverage included in aggregate %.

4 of 9 new or added lines in 3 files covered. (44.44%)

2495 existing lines in 237 files now uncovered.

3540 of 6249 relevant lines covered (56.65%)

8.62 hits per line

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

20.83
/src/datasources/locking-api/locking-api.service.ts
1
import { IConfigurationService } from '@/config/configuration.service.interface';
14✔
2
import { HttpErrorFactory } from '@/datasources/errors/http-error-factory';
14✔
3
import {
14✔
4
  NetworkService,
5
  INetworkService,
6
} from '@/datasources/network/network.service.interface';
7
import { Page } from '@/domain/entities/page.entity';
8
import { ILockingApi } from '@/domain/interfaces/locking-api.interface';
9
import { LockingEvent } from '@/domain/locking/entities/locking-event.entity';
10
import { Rank } from '@/domain/locking/entities/rank.entity';
11
import { Inject } from '@nestjs/common';
14✔
12

13
export class LockingApi implements ILockingApi {
14✔
14
  private readonly baseUri: string;
15

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

27
  async getRank(safeAddress: `0x${string}`): Promise<Rank> {
UNCOV
28
    try {
×
UNCOV
29
      const url = `${this.baseUri}/api/v1/leaderboard/${safeAddress}`;
×
UNCOV
30
      const { data } = await this.networkService.get<Rank>({ url });
×
UNCOV
31
      return data;
×
32
    } catch (error) {
UNCOV
33
      throw this.httpErrorFactory.from(error);
×
34
    }
35
  }
36

37
  async getLeaderboard(args: {
38
    limit?: number;
39
    offset?: number;
40
  }): Promise<Page<Rank>> {
UNCOV
41
    try {
×
UNCOV
42
      const url = `${this.baseUri}/api/v1/leaderboard`;
×
UNCOV
43
      const { data } = await this.networkService.get<Page<Rank>>({
×
44
        url,
45
        networkRequest: {
46
          params: {
47
            limit: args.limit,
48
            offset: args.offset,
49
          },
50
        },
51
      });
UNCOV
52
      return data;
×
53
    } catch (error) {
UNCOV
54
      throw this.httpErrorFactory.from(error);
×
55
    }
56
  }
57

58
  async getLockingHistory(args: {
59
    safeAddress: `0x${string}`;
60
    limit?: number;
61
    offset?: number;
62
  }): Promise<Page<LockingEvent>> {
UNCOV
63
    try {
×
UNCOV
64
      const url = `${this.baseUri}/api/v1/all-events/${args.safeAddress}`;
×
UNCOV
65
      const { data } = await this.networkService.get<Page<LockingEvent>>({
×
66
        url,
67
        networkRequest: {
68
          params: {
69
            limit: args.limit,
70
            offset: args.offset,
71
          },
72
        },
73
      });
UNCOV
74
      return data;
×
75
    } catch (error) {
UNCOV
76
      throw this.httpErrorFactory.from(error);
×
77
    }
78
  }
79
}
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