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

safe-global / safe-client-gateway / 8141876613

04 Mar 2024 02:30PM UTC coverage: 93.302% (+0.2%) from 93.066%
8141876613

push

github

web-flow
Scaffold locking controller (#1231)

This adds a scaffold for the controller, hidden behind a feature flag.

## Changes

- Add `LockingService`:
  - `getRank`
  - `getLeaderboard`
  - `getLockingHistory`
- Add `GET` `/v1/locking/leaderboard`
- Add `GET` `/v1/locking/:safeAddress/rank`
- Add `GET` `/v1/locking/:safeAddress/history`
- Add `LockingDomainModule`
- Add `LockingModule`

1709 of 2072 branches covered (82.48%)

Branch coverage included in aggregate %.

30 of 42 new or added lines in 5 files covered. (71.43%)

6384 of 6602 relevant lines covered (96.7%)

347.0 hits per line

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

78.57
/src/routes/locking/locking.controller.ts
1
import { LockingEvent } from '@/domain/locking/entities/locking-event.entity';
2
import { Rank } from '@/domain/locking/entities/rank.entity';
3
import { PaginationDataDecorator } from '@/routes/common/decorators/pagination.data.decorator';
82✔
4
import { RouteUrlDecorator } from '@/routes/common/decorators/route.url.decorator';
82✔
5
import { Page } from '@/routes/common/entities/page.entity';
6
import { PaginationData } from '@/routes/common/pagination/pagination.data';
82✔
7
import { LockingService } from '@/routes/locking/locking.service';
82✔
8
import { Controller, Get, Param } from '@nestjs/common';
82✔
9
import { ApiTags } from '@nestjs/swagger';
82✔
10

11
@ApiTags('locking')
12
@Controller({
13
  path: 'locking',
14
  version: '1',
15
})
16
export class LockingController {
82✔
17
  constructor(private readonly lockingService: LockingService) {}
1,034✔
18

19
  @Get('/:safeAddress/rank')
20
  async getRank(@Param('safeAddress') safeAddress: string): Promise<Rank> {
82✔
NEW
21
    return this.lockingService.getRank(safeAddress);
×
22
  }
23

24
  @Get('/leaderboard')
25
  async getLeaderboard(
82✔
26
    @RouteUrlDecorator() routeUrl: URL,
27
    @PaginationDataDecorator() paginationData: PaginationData,
28
  ): Promise<Page<Rank>> {
NEW
29
    return this.lockingService.getLeaderboard({ routeUrl, paginationData });
×
30
  }
31

32
  @Get('/:safeAddress/history')
33
  async getLockingHistory(
82✔
34
    @Param('safeAddress') safeAddress: string,
35
    @RouteUrlDecorator() routeUrl: URL,
36
    @PaginationDataDecorator() paginationData: PaginationData,
37
  ): Promise<Page<LockingEvent>> {
NEW
38
    return this.lockingService.getLockingHistory({
×
39
      safeAddress,
40
      routeUrl,
41
      paginationData,
42
    });
43
  }
44
}
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