-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rahul/ifl 1733 add an endpoint to update block graffiti in syncer (#1654
) * Adding block service function and test * adding tests for block controller * using dto object and updating tests * removing console log * udpating error message * Removing regex global
- Loading branch information
Showing
5 changed files
with
206 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { | ||
IsDefined, | ||
IsString, | ||
Matches, | ||
MaxLength, | ||
MinLength, | ||
} from 'class-validator'; | ||
|
||
export class UpdateGraffitiDto { | ||
@ApiProperty({ description: 'Block hash' }) | ||
@IsDefined({ | ||
message: '"hash" of the block', | ||
}) | ||
@IsString() | ||
readonly hash!: string; | ||
|
||
@ApiProperty({ description: 'Block graffiti' }) | ||
@IsDefined({ | ||
message: '"graffiti" of the block', | ||
}) | ||
@MinLength(64, { | ||
message: 'must be exactly 64 characters in length', | ||
}) | ||
@MaxLength(64, { | ||
message: 'must be exactly 64 characters in length', | ||
}) | ||
@Matches(/^[0-9A-Fa-f]+$/, { | ||
message: 'must be 64 length hex string', | ||
}) | ||
readonly graffiti!: string; | ||
} |