File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ export const TWENTY_FOUR_HOURS = 24 * ONE_HOUR
55
66export const LEADERBOARD_KEY = 'edgerates:topAssets'
77export const TOKEN_TYPES_KEY = 'tokenTypes'
8+
9+ export const CRYPTO_LIMIT = 100
10+ export const FIAT_LIMIT = 256
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { ExpressRequest } from 'serverlet/express'
44
55import { config } from '../config'
66import { slackPoster } from '../utils/postToSlack'
7- import { ONE_MINUTE } from './constants'
7+ import { CRYPTO_LIMIT , FIAT_LIMIT , ONE_MINUTE } from './constants'
88import { getRates } from './getRates'
99import { dbSettings } from './providers/couch'
1010import {
@@ -26,11 +26,11 @@ const fixIncomingGetRatesParams = (
2626
2727 const params = asIncomingGetRatesParams ( rawParams )
2828
29- if ( params . crypto . length > 100 ) {
30- throw new Error ( ' crypto array must be less than 100' )
29+ if ( params . crypto . length > CRYPTO_LIMIT ) {
30+ throw new Error ( ` crypto array must be less than ${ CRYPTO_LIMIT } ` )
3131 }
32- if ( params . fiat . length > 256 ) {
33- throw new Error ( ' fiat array must be less than 256' )
32+ if ( params . fiat . length > FIAT_LIMIT ) {
33+ throw new Error ( ` fiat array must be less than ${ FIAT_LIMIT } ` )
3434 }
3535 if ( params . targetFiat !== 'USD' ) {
3636 throw new Error ( 'targetFiat must be USD' )
You can’t perform that action at this time.
0 commit comments