From b080ab61c2525dbbf5e2e7cf25c0a73589a05827 Mon Sep 17 00:00:00 2001 From: Taras Alekhin Date: Mon, 4 Mar 2024 11:51:07 +0100 Subject: [PATCH] feat: update error swagger type, fixed typos --- README.md | 9 +++++---- src/http/common/dto/ErrorResponseType.ts | 5 ----- src/http/common/dto/error-response-type.ts | 20 +++++++++++++++++++ .../request-time/request-time.controller.ts | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-) delete mode 100644 src/http/common/dto/ErrorResponseType.ts create mode 100644 src/http/common/dto/error-response-type.ts diff --git a/README.md b/README.md index 63024b5..5c947aa 100644 --- a/README.md +++ b/README.md @@ -43,16 +43,17 @@ To create a new release: 1. After publication, the action to create a release bump will be triggered automatically. ## How calculation works + Requests are processed by Lido Accounting Oracle and finalized at time of report, when frame ends. More about finalization process [here](https://docs.lido.fi/guides/oracle-spec/accounting-oracle#request-finalization) Each withdrawal request finalizing by next sources of eth: -1. Buffer. [method](https://docs.lido.fi/contracts/lido#getbufferedether) from Lido Contract -2. Vault Balances. [WithdrawalVaults](https://docs.lido.fi/contracts/withdrawal-vault) and [ExecutionLayerRewardsVault](https://docs.lido.fi/contracts/lido-execution-layer-rewards-vault) are income potential income in the end of current frame. +1. Buffer. It is [method](https://docs.lido.fi/contracts/lido#getbufferedether) from Lido Contract +2. Vault Balances. [WithdrawalVaults](https://docs.lido.fi/contracts/withdrawal-vault) and [ExecutionLayerRewardsVault](https://docs.lido.fi/contracts/lido-execution-layer-rewards-vault) are potential income in the end of current frame. 3. Rewards. Calculation uses rewards from previous oracle report as approximate number of rewards per future frames. -4. Withdrawable Validators. If network already has some Lido validators with withdrawable epoch will consider them as potential income to buffer for frame of withdrawable epoch of validator + sweeping mean -5. Exit Validators. If previous sources of eth is not enough VEBO is going to exit Lido validators. This process is described [here](https://docs.lido.fi/guides/oracle-spec/validator-exit-bus/). +4. Withdrawable Validators. If network has Lido validators with withdrawable epoch they will be considered as potential income to buffer for frame of withdrawable epoch of validator + sweeping mean +5. Exit Validators. If previous sources of eth is not enough Validator Exit Bus Oracle is going to exit Lido validators to accumulate necessary amount eth. This process is described [here](https://docs.lido.fi/guides/oracle-spec/validator-exit-bus/). Note, the requests made close to end of frame are postponed to next frame because of limit [here](https://docs.lido.fi/contracts/oracle-report-sanity-checker#getoraclereportlimits). diff --git a/src/http/common/dto/ErrorResponseType.ts b/src/http/common/dto/ErrorResponseType.ts deleted file mode 100644 index 72934dd..0000000 --- a/src/http/common/dto/ErrorResponseType.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class ErrorResponseType { - statusCode: number; - message: string[]; - error: string; -} diff --git a/src/http/common/dto/error-response-type.ts b/src/http/common/dto/error-response-type.ts new file mode 100644 index 0000000..e5b7fd0 --- /dev/null +++ b/src/http/common/dto/error-response-type.ts @@ -0,0 +1,20 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class ErrorResponseType { + @ApiProperty({ + example: 400, + description: 'Http status code', + }) + statusCode: number; + + @ApiProperty({ + description: 'Array of validation error messages', + }) + message: string[]; + + @ApiProperty({ + description: 'Error text', + example: 'Bad Request', + }) + error: string; +} diff --git a/src/http/request-time/request-time.controller.ts b/src/http/request-time/request-time.controller.ts index aec73be..0a37877 100644 --- a/src/http/request-time/request-time.controller.ts +++ b/src/http/request-time/request-time.controller.ts @@ -17,7 +17,7 @@ import { RequestTimeDto, RequestTimeOptionsDto } from './dto'; import { RequestTimeV2Dto } from './dto/request-time-v2.dto'; import { RequestTimeByRequestIdDto } from './dto/request-time-by-request-id.dto'; import { RequestsTimeOptionsDto } from './dto/requests-time-options.dto'; -import { ErrorResponseType } from '../common/dto/ErrorResponseType'; +import { ErrorResponseType } from '../common/dto/error-response-type'; @Controller(HTTP_PATHS[1]['request-time']) @ApiTags('Request Time')