Skip to content

Commit

Permalink
refactor(core-json-rpc): improved version of #2593
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed May 21, 2019
1 parent c85e825 commit 0c92cf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions packages/core-json-rpc/src/server/methods/blocks/info.ts
Expand Up @@ -10,11 +10,8 @@ export const blockInfo = {
return response ? response.data : Boom.notFound(`Block ${params.id} could not be found.`);
},
schema: {
id: Joi.alternatives().try(
Joi.number()
.unsafe()
.required(),
Joi.string().length(64),
),
id: Joi.alternatives()
.try(Joi.number().unsafe(), Joi.string().length(64))
.required(),
},
};
Expand Up @@ -18,12 +18,9 @@ export const blockTransactions = {
: Boom.notFound(`Block ${params.id} could not be found.`);
},
schema: {
id: Joi.alternatives().try(
Joi.number()
.unsafe()
.required(),
Joi.string().length(64),
),
id: Joi.alternatives()
.try(Joi.number().unsafe(), Joi.string().length(64))
.required(),
offset: Joi.number().default(0),
},
};

0 comments on commit 0c92cf3

Please sign in to comment.