Skip to content

Commit

Permalink
Add missing type annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
  • Loading branch information
awrichar committed Jan 4, 2023
1 parent 25cc044 commit e215755
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/tokens/tokens.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Res } from '@nestjs/common';
import { ApiBody, ApiOperation, ApiResponse } from '@nestjs/swagger';
import { Response } from 'express';
import { RequestContext } from '../request-context/request-context.decorator';
import { Context, RequestContext } from '../request-context/request-context.decorator';
import { EventStreamReply } from '../event-stream/event-stream.interfaces';
import { BlockchainConnectorService } from './blockchain.service';
import {
Expand All @@ -39,7 +39,7 @@ export class TokensController {
@Post('init')
@HttpCode(204)
@ApiOperation({ summary: 'Perform one-time initialization (if not auto-initialized)' })
init(@RequestContext() ctx) {
init(@RequestContext() ctx: Context) {
return this.service.init(ctx);
}

Expand All @@ -53,7 +53,7 @@ export class TokensController {
@ApiResponse({ status: 200, type: TokenPoolEvent })
@ApiResponse({ status: 202, type: AsyncResponse })
async createPool(
@RequestContext() ctx,
@RequestContext() ctx: Context,
@Body() dto: TokenPool,
@Res({ passthrough: true }) res: Response,
) {
Expand All @@ -72,7 +72,7 @@ export class TokensController {
summary: 'Activate a token pool to begin receiving transfer events',
})
@ApiBody({ type: TokenPoolActivate })
activatePool(@RequestContext() ctx, @Body() dto: TokenPoolActivate) {
activatePool(@RequestContext() ctx: Context, @Body() dto: TokenPoolActivate) {
return this.service.activatePool(ctx, dto);
}

Expand All @@ -85,7 +85,7 @@ export class TokensController {
})
@ApiBody({ type: TokenMint })
@ApiResponse({ status: 202, type: AsyncResponse })
mint(@RequestContext() ctx, @Body() dto: TokenMint) {
mint(@RequestContext() ctx: Context, @Body() dto: TokenMint) {
return this.service.mint(ctx, dto);
}

Expand All @@ -98,7 +98,7 @@ export class TokensController {
})
@ApiBody({ type: TokenTransfer })
@ApiResponse({ status: 202, type: AsyncResponse })
transfer(@RequestContext() ctx, @Body() dto: TokenTransfer) {
transfer(@RequestContext() ctx: Context, @Body() dto: TokenTransfer) {
return this.service.transfer(ctx, dto);
}

Expand All @@ -110,7 +110,7 @@ export class TokensController {
})
@ApiBody({ type: TokenApproval })
@ApiResponse({ status: 202, type: AsyncResponse })
approve(@RequestContext() ctx, @Body() dto: TokenApproval) {
approve(@RequestContext() ctx: Context, @Body() dto: TokenApproval) {
return this.service.approval(ctx, dto);
}

Expand All @@ -123,14 +123,14 @@ export class TokensController {
})
@ApiBody({ type: TokenBurn })
@ApiResponse({ status: 202, type: AsyncResponse })
burn(@RequestContext() ctx, @Body() dto: TokenBurn) {
burn(@RequestContext() ctx: Context, @Body() dto: TokenBurn) {
return this.service.burn(ctx, dto);
}

@Get('receipt/:id')
@ApiOperation({ summary: 'Retrieve the result of an async operation' })
@ApiResponse({ status: 200, type: EventStreamReply })
getReceipt(@RequestContext() ctx, @Param('id') id: string) {
getReceipt(@RequestContext() ctx: Context, @Param('id') id: string) {
return this.blockchain.getReceipt(ctx, id);
}
}

0 comments on commit e215755

Please sign in to comment.