Skip to content

Commit dc22f6e

Browse files
committed
Fix reason filter of CCCChange to include all reasons
"deposit", "validator" is added.
1 parent 3926bad commit dc22f6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/routers/validator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as express from "express";
22
import * as Joi from "joi";
3+
import { defaultAllReasons } from "../models/cccChanges";
34

45
const expressValidation = require("express-validation");
56

@@ -43,9 +44,6 @@ const ADDRESS_TYPES = [
4344
"Approver",
4445
"Registrar"
4546
];
46-
47-
const REASON_TYPES = ["fee", "author", "stake", "tx", "initial_distribution"];
48-
4947
const LOG_FILTER = ["block", "tx", ...TYPES];
5048

5149
// FIXME:
@@ -61,7 +59,9 @@ const type = Joi.string().regex(
6159
new RegExp(`^(${TYPES.join("|")})(,(${TYPES.join("|")}))*$`)
6260
);
6361
const reasonFilter = Joi.string().regex(
64-
new RegExp(`^(${REASON_TYPES.join("|")})(,(${REASON_TYPES.join("|")}))*$`)
62+
new RegExp(
63+
`^(${defaultAllReasons.join("|")})(,(${defaultAllReasons.join("|")}))*$`
64+
)
6565
);
6666
const shardId = Joi.number();
6767
const onlyConfirmed = Joi.boolean();

0 commit comments

Comments
 (0)