diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-08-23 16:28:53 +1000 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-08-23 16:28:53 +1000 |
commit | 59193779ba2860708e05b7db6751718d3b946efe (patch) | |
tree | aa4055a2f61f83e7430ca15b43f5e72f4434896f | |
parent | 54563907c721a90f8fc9861a62fe7c214b5c5041 (diff) | |
download | BIP39-59193779ba2860708e05b7db6751718d3b946efe.tar.gz BIP39-59193779ba2860708e05b7db6751718d3b946efe.tar.zst BIP39-59193779ba2860708e05b7db6751718d3b946efe.zip |
Tests for all other coins / networks
-rw-r--r-- | tests.js | 220 |
1 files changed, 218 insertions, 2 deletions
@@ -165,7 +165,7 @@ page.open(url, function(status) { | |||
165 | // Network can be set to bitcoin testnet | 165 | // Network can be set to bitcoin testnet |
166 | function() { | 166 | function() { |
167 | page.open(url, function(status) { | 167 | page.open(url, function(status) { |
168 | // set the phrase and passphrase | 168 | // set the phrase and coin |
169 | var expected = "mucaU5iiDaJDb69BHLeDv8JFfGiyg2nJKi"; | 169 | var expected = "mucaU5iiDaJDb69BHLeDv8JFfGiyg2nJKi"; |
170 | page.evaluate(function() { | 170 | page.evaluate(function() { |
171 | $(".phrase").val("abandon abandon ability"); | 171 | $(".phrase").val("abandon abandon ability"); |
@@ -190,15 +190,231 @@ page.open(url, function(status) { | |||
190 | }); | 190 | }); |
191 | }, | 191 | }, |
192 | 192 | ||
193 | // TODO finish these tests | ||
194 | // Network can be set to litecoin | 193 | // Network can be set to litecoin |
194 | function() { | ||
195 | page.open(url, function(status) { | ||
196 | // set the phrase and coin | ||
197 | var expected = "LQ4XU8RX2ULPmPq9FcUHdVmPVchP9nwXdn"; | ||
198 | page.evaluate(function() { | ||
199 | $(".phrase").val("abandon abandon ability"); | ||
200 | $(".phrase").trigger("input"); | ||
201 | $(".network option[selected]").removeAttr("selected"); | ||
202 | $(".network option[value=2]").prop("selected", true); | ||
203 | $(".network").trigger("change"); | ||
204 | }); | ||
205 | // check the address is generated correctly | ||
206 | setTimeout(function() { | ||
207 | var actual = page.evaluate(function() { | ||
208 | return $(".address:first").text(); | ||
209 | }); | ||
210 | if (actual != expected) { | ||
211 | console.log("Litecoin address is incorrect"); | ||
212 | console.log("Expected: " + expected); | ||
213 | console.log("Actual: " + actual); | ||
214 | fail(); | ||
215 | } | ||
216 | next(); | ||
217 | }, 1000); | ||
218 | }); | ||
219 | }, | ||
220 | |||
195 | // Network can be set to dogecoin | 221 | // Network can be set to dogecoin |
222 | function() { | ||
223 | page.open(url, function(status) { | ||
224 | // set the phrase and coin | ||
225 | var expected = "DPQH2AtuzkVSG6ovjKk4jbUmZ6iXLpgbJA"; | ||
226 | page.evaluate(function() { | ||
227 | $(".phrase").val("abandon abandon ability"); | ||
228 | $(".phrase").trigger("input"); | ||
229 | $(".network option[selected]").removeAttr("selected"); | ||
230 | $(".network option[value=3]").prop("selected", true); | ||
231 | $(".network").trigger("change"); | ||
232 | }); | ||
233 | // check the address is generated correctly | ||
234 | setTimeout(function() { | ||
235 | var actual = page.evaluate(function() { | ||
236 | return $(".address:first").text(); | ||
237 | }); | ||
238 | if (actual != expected) { | ||
239 | console.log("Dogecoin address is incorrect"); | ||
240 | console.log("Expected: " + expected); | ||
241 | console.log("Actual: " + actual); | ||
242 | fail(); | ||
243 | } | ||
244 | next(); | ||
245 | }, 1000); | ||
246 | }); | ||
247 | }, | ||
248 | |||
196 | // Network can be set to shadowcash | 249 | // Network can be set to shadowcash |
250 | function() { | ||
251 | page.open(url, function(status) { | ||
252 | // set the phrase and coin | ||
253 | var expected = "SiSZtfYAXEFvMm3XM8hmtkGDyViRwErtCG"; | ||
254 | page.evaluate(function() { | ||
255 | $(".phrase").val("abandon abandon ability"); | ||
256 | $(".phrase").trigger("input"); | ||
257 | $(".network option[selected]").removeAttr("selected"); | ||
258 | $(".network option[value=4]").prop("selected", true); | ||
259 | $(".network").trigger("change"); | ||
260 | }); | ||
261 | // check the address is generated correctly | ||
262 | setTimeout(function() { | ||
263 | var actual = page.evaluate(function() { | ||
264 | return $(".address:first").text(); | ||
265 | }); | ||
266 | if (actual != expected) { | ||
267 | console.log("Shadowcash address is incorrect"); | ||
268 | console.log("Expected: " + expected); | ||
269 | console.log("Actual: " + actual); | ||
270 | fail(); | ||
271 | } | ||
272 | next(); | ||
273 | }, 1000); | ||
274 | }); | ||
275 | }, | ||
276 | |||
197 | // Network can be set to shadowcash testnet | 277 | // Network can be set to shadowcash testnet |
278 | function() { | ||
279 | page.open(url, function(status) { | ||
280 | // set the phrase and coin | ||
281 | var expected = "tM2EDpVKaTiEg2NZg3yKg8eqjLr55BErHe"; | ||
282 | page.evaluate(function() { | ||
283 | $(".phrase").val("abandon abandon ability"); | ||
284 | $(".phrase").trigger("input"); | ||
285 | $(".network option[selected]").removeAttr("selected"); | ||
286 | $(".network option[value=5]").prop("selected", true); | ||
287 | $(".network").trigger("change"); | ||
288 | }); | ||
289 | // check the address is generated correctly | ||
290 | setTimeout(function() { | ||
291 | var actual = page.evaluate(function() { | ||
292 | return $(".address:first").text(); | ||
293 | }); | ||
294 | if (actual != expected) { | ||
295 | console.log("Shadowcash testnet address is incorrect"); | ||
296 | console.log("Expected: " + expected); | ||
297 | console.log("Actual: " + actual); | ||
298 | fail(); | ||
299 | } | ||
300 | next(); | ||
301 | }, 1000); | ||
302 | }); | ||
303 | }, | ||
304 | |||
198 | // Network can be set to viacoin | 305 | // Network can be set to viacoin |
306 | function() { | ||
307 | page.open(url, function(status) { | ||
308 | // set the phrase and coin | ||
309 | var expected = "Vq9Eq4N5SQnjqZvxtxzo7hZPW5XnyJsmXT"; | ||
310 | page.evaluate(function() { | ||
311 | $(".phrase").val("abandon abandon ability"); | ||
312 | $(".phrase").trigger("input"); | ||
313 | $(".network option[selected]").removeAttr("selected"); | ||
314 | $(".network option[value=6]").prop("selected", true); | ||
315 | $(".network").trigger("change"); | ||
316 | }); | ||
317 | // check the address is generated correctly | ||
318 | setTimeout(function() { | ||
319 | var actual = page.evaluate(function() { | ||
320 | return $(".address:first").text(); | ||
321 | }); | ||
322 | if (actual != expected) { | ||
323 | console.log("Viacoin address is incorrect"); | ||
324 | console.log("Expected: " + expected); | ||
325 | console.log("Actual: " + actual); | ||
326 | fail(); | ||
327 | } | ||
328 | next(); | ||
329 | }, 1000); | ||
330 | }); | ||
331 | }, | ||
332 | |||
199 | // Network can be set to viacoin testnet | 333 | // Network can be set to viacoin testnet |
334 | function() { | ||
335 | page.open(url, function(status) { | ||
336 | // set the phrase and coin | ||
337 | var expected = "tM2EDpVKaTiEg2NZg3yKg8eqjLr55BErHe"; | ||
338 | page.evaluate(function() { | ||
339 | $(".phrase").val("abandon abandon ability"); | ||
340 | $(".phrase").trigger("input"); | ||
341 | $(".network option[selected]").removeAttr("selected"); | ||
342 | $(".network option[value=7]").prop("selected", true); | ||
343 | $(".network").trigger("change"); | ||
344 | }); | ||
345 | // check the address is generated correctly | ||
346 | setTimeout(function() { | ||
347 | var actual = page.evaluate(function() { | ||
348 | return $(".address:first").text(); | ||
349 | }); | ||
350 | if (actual != expected) { | ||
351 | console.log("Viacoin testnet address is incorrect"); | ||
352 | console.log("Expected: " + expected); | ||
353 | console.log("Actual: " + actual); | ||
354 | fail(); | ||
355 | } | ||
356 | next(); | ||
357 | }, 1000); | ||
358 | }); | ||
359 | }, | ||
360 | |||
200 | // Network can be set to jumbucks | 361 | // Network can be set to jumbucks |
362 | function() { | ||
363 | page.open(url, function(status) { | ||
364 | // set the phrase and coin | ||
365 | var expected = "JLEXccwDXADK4RxBPkRez7mqsHVoJBEUew"; | ||
366 | page.evaluate(function() { | ||
367 | $(".phrase").val("abandon abandon ability"); | ||
368 | $(".phrase").trigger("input"); | ||
369 | $(".network option[selected]").removeAttr("selected"); | ||
370 | $(".network option[value=8]").prop("selected", true); | ||
371 | $(".network").trigger("change"); | ||
372 | }); | ||
373 | // check the address is generated correctly | ||
374 | setTimeout(function() { | ||
375 | var actual = page.evaluate(function() { | ||
376 | return $(".address:first").text(); | ||
377 | }); | ||
378 | if (actual != expected) { | ||
379 | console.log("Jumbucks address is incorrect"); | ||
380 | console.log("Expected: " + expected); | ||
381 | console.log("Actual: " + actual); | ||
382 | fail(); | ||
383 | } | ||
384 | next(); | ||
385 | }, 1000); | ||
386 | }); | ||
387 | }, | ||
388 | |||
201 | // Network can be set to clam | 389 | // Network can be set to clam |
390 | function() { | ||
391 | page.open(url, function(status) { | ||
392 | // set the phrase and coin | ||
393 | var expected = "xCp4sakjVx4pUAZ6cBCtuin8Ddb6U1sk9y"; | ||
394 | page.evaluate(function() { | ||
395 | $(".phrase").val("abandon abandon ability"); | ||
396 | $(".phrase").trigger("input"); | ||
397 | $(".network option[selected]").removeAttr("selected"); | ||
398 | $(".network option[value=9]").prop("selected", true); | ||
399 | $(".network").trigger("change"); | ||
400 | }); | ||
401 | // check the address is generated correctly | ||
402 | setTimeout(function() { | ||
403 | var actual = page.evaluate(function() { | ||
404 | return $(".address:first").text(); | ||
405 | }); | ||
406 | if (actual != expected) { | ||
407 | console.log("CLAM address is incorrect"); | ||
408 | console.log("Expected: " + expected); | ||
409 | console.log("Actual: " + actual); | ||
410 | fail(); | ||
411 | } | ||
412 | next(); | ||
413 | }, 1000); | ||
414 | }); | ||
415 | }, | ||
416 | |||
417 | // TODO finish these tests | ||
202 | // BIP39 seed is set from phrase | 418 | // BIP39 seed is set from phrase |
203 | // BIP32 root key is set from phrase | 419 | // BIP32 root key is set from phrase |
204 | 420 | ||