Added brainwallet test case.

This commit is contained in:
ricmoo 2016-08-01 19:32:57 -04:00
parent 839c2a10aa
commit 742bcc753f
2 changed files with 21 additions and 0 deletions

@ -31,6 +31,9 @@ module.exports.testContracts = require('./test-contracts.js');
// Test the secret storage JSON wallet encryption/decryption
module.exports.testSecretStorage = require('./test-secret-storage.js');
// Test brain wallet generation
module.exports.testBrainWallet = require('./test-brain-wallet.js');
// Test the solidity encoding/decoding parameters
module.exports.testSolidityCoder = require('./test-solidity-coder.js');

@ -0,0 +1,18 @@
'use strict';
var Wallet = require('../index.js');
module.exports = function(test) {
var username = new Wallet.utils.Buffer('ricmoo', 'utf8');
var password = new Wallet.utils.Buffer('password', 'utf8');
console.log(username, password);
Wallet.summonBrainWallet(username, password, function(error, wallet, progress) {
if (error) {
test.ok(false, 'Failed to generarte brain wallet');
} else if (wallet) {
test.equal(wallet.address, '0xbed9d2E41BdD066f702C4bDB86eB3A3740101acC', 'wrong wallet generated');
test.done();
}
});
}
module.exports.testSelf = module.exports;