414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
|
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
puts "\[7.FAIL\] Got: $balance"
puts "\[7.FAIL\] Exp: $balance_expected"
return false
}
return true
}
proc test_wallet {} {
set expectedSeed "7ED0C65229A00520A9CDD2C18C1172EFDF34467A8785E5D8D30916E4F6122273"
set walletJSON {{
"0000000000000000000000000000000000000000000000000000000000000000": "0000000000000000000000000000000000000000000000000000000000000004",
"0000000000000000000000000000000000000000000000000000000000000001": "F551DD44FC8A78D40BAF56ACD96390251246ADE5C805778EB54F3F28B84A8C84",
"0000000000000000000000000000000000000000000000000000000000000002": "520E57026946425A4E1FF5596BF8B1D325AE43C63C11CC357CB598F8C934765A",
"0000000000000000000000000000000000000000000000000000000000000003": "D28BBF12ADEB7C066205BEDA7F37904BD86B311DDE0FD06481144EBC89B00790",
"0000000000000000000000000000000000000000000000000000000000000004": "2399A083C600AA0572F5E36247D978FCFC840405F8D4B6D33161C0066A55F431",
"0000000000000000000000000000000000000000000000000000000000000005": "685FCF7537EE1AA8055638C5C278FBBEE77C0242D8A6F054534E476EE33F33FF",
"0000000000000000000000000000000000000000000000000000000000000006": "0000000000000000000000000000000000000000000000000000000000000000"
}}
array set wallet [::nano::wallet::decode_backup "" $walletJSON]
if {$wallet(seed) ne $expectedSeed} {
puts "\[1.FAIL\] Got: $wallet(seed)"
puts "\[1.FAIL\] Exp: $expectedSeed"
return false
}
return true
}
set tests {
selftest
signatures
hashing
keygeneration
addressformat
blocks
work
balances
wallet
}
foreach test $tests {
puts -nonewline "\[ \] $test"
flush stdout
if {[catch {
|