@@ -5,6 +5,7 @@ import { identity, includes } from 'lodash';
55import { isValidAddress, ETH_ZERO_ADDR, ETH_ZERO_ADDR_SHORT } from './wallet';
66import patp2dec from './patp2dec';
77import { patpStringLength } from './lib';
8+import { MIN_GALAXY, MAX_GALAXY } from './constants';
89
910// NOTE: do not use the /g modifier for these regexes
1011// https://stackoverflow.com/a/21373261
@@ -90,12 +91,12 @@ export const validateGalaxy = m =>
9091 let point;
9192 try {
9293 point = patp2dec(d);
93− return point >= 0 && point < 256;
94+ return point >= MIN_GALAXY && point <= MAX_GALAXY;
9495 } catch (e) {
9596 return false;
9697 }
9798 },
98− error: 'This is not a valid galaxy',
99+ error: 'This is not a valid galaxy.',
99100 });
100101
101102export const validatePoint = m =>
@@ -108,7 +109,7 @@ export const validatePoint = m =>
108109 return false;
109110 }
110111 },
111− error: 'This is not a valid point',
112+ error: 'This is not a valid point.',
112113 });
113114
114115export const validateTicket = m =>
@@ -121,7 +122,7 @@ export const validateTicket = m =>
121122 return false;
122123 }
123124 },
124− error: 'This is not a valid ticket',
125+ error: 'This is not a valid ticket.',
125126 });
126127
127128export const validateShard = m =>
@@ -134,7 +135,7 @@ export const validateShard = m =>
134135 return false;
135136 }
136137 },
137− error: 'This is not a valid shard',
138+ error: 'This is not a valid shard.',
138139 });
139140
140141export const validateOneOf = (options = []) => m =>
@@ -148,7 +149,7 @@ export const validateHexString = m =>
148149 simpleValidatorWrapper({
149150 prevMessage: m,
150151 validator: d => isHexString.test(d),
151− error: 'This is not a valid hex string',
152+ error: 'This is not a valid hex string.',
152153 });
153154
154155// @deprecate
@@ -156,7 +157,7 @@ export const validateNetworkKey = m =>
156157 simpleValidatorWrapper({
157158 prevMessage: m,
158159 validator: d => plain64CharHexValue.test(d),
159− error: 'This is not a valid network key',
160+ error: 'This is not a valid network key.',
160161 });
161162
162163// @deprecate
@@ -164,7 +165,7 @@ export const validateNetworkSeed = m =>
164165 simpleValidatorWrapper({
165166 prevMessage: m,
166167 validator: d => plain64CharHexValue.test(d),
167− error: 'This is not a valid network seed',
168+ error: 'This is not a valid network seed.',
168169 });
169170
170171// Checks if a string is a valid ethereum address
@@ -172,14 +173,14 @@ export const validateEthereumAddress = m =>
172173 simpleValidatorWrapper({
173174 prevMessage: m,
174175 validator: d => isValidAddress(d),
175− error: 'This is not a valid Ethereum address',
176+ error: 'This is not a valid Ethereum address.',
176177 });
177178
178179export const validateEmail = m =>
179180 simpleValidatorWrapper({
180181 prevMessage: m,
181182 validator: d => emailRegExp.test(d),
182− error: 'This is not a valid email address',
183+ error: 'This is not a valid email address.',
183184 });
184185
185186export const validateInt = m =>
@@ -194,7 +195,7 @@ export const validateInt = m =>
194195 return false;
195196 }
196197 },
197− error: 'This is not a valid number',
198+ error: 'This is not a valid number.',
198199 });
199200
200201export const validateExactly = (value, error) => m =>
@@ -208,7 +209,7 @@ export const validateNotAny = (values = []) => m =>
208209 simpleValidatorWrapper({
209210 prevMessage: m,
210211 validator: d => !values.includes(d),
211− error: `Cannot be ${m.data}`,
212+ error: `Cannot be ${m.data}.`,
212213 });
213214
214215export const validateLength = l => m =>
@@ -221,7 +222,7 @@ export const validateLength = l => m =>
221222 return false;
222223 }
223224 },
224− error: `Must be exactly ${l} characters`,
225+ error: `Must be exactly ${l} characters.`,
225226 });
226227
227228export const validateMaximumLength = l => m =>
@@ -241,7 +242,7 @@ export const validateGreaterThan = l => m =>
241242 simpleValidatorWrapper({
242243 prevMessage: m,
243244 validator: d => d > l,
244− error: `Must be at least ${l}`,
245+ error: `Must be at least ${l}.`,
245246 });
246247
247248export const validatePatpByteLength = byteLength => {