CodeChain-io / CodeChain-io/codechain-indexer

Validate `firstEvaluatedKey` and `lastEvaluatedKey`'s length

Aperta
#349 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
21
Fork
15
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Here is the code that validates `firstEvaluatedKey` and `lastEvaluatedKey`.

```
export const txPaginationSchema = {
firstEvaluatedKey: Joi.array().items(Joi.number(), Joi.number()),
lastEvaluatedKey: Joi.array().items(Joi.number(), Joi.number())
};
```

The above condition does not check an input array's length. All of these inputs `[]`, `[1]`, `[1,2]` and `[1,2,3]` are valid in the current implementation. Only `[1,2]` should pass the validation and other `[]`, `[1]`, `[1,2,3]` should fail the validation.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.