Added brainwallet test case.
This commit is contained in:
parent
839c2a10aa
commit
742bcc753f
@ -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');
|
||||
|
18
tests/test-brain-wallet.js
Normal file
18
tests/test-brain-wallet.js
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user