Added test for generateVanityAddress() with string contructor

This commit is contained in:
holgerd77 2018-02-09 14:36:11 +01:00
parent 8a5ff2467e
commit 93445039f9
1 changed files with 7 additions and 1 deletions

View File

@ -119,12 +119,18 @@ describe('.generate()', function () {
})
describe('.generateVanityAddress()', function () {
it('should generate an account with 000 prefix', function () {
it('should generate an account with 000 prefix (object)', function () {
var wallet = Wallet.generateVanityAddress(/^000/)
assert.equal(wallet.getPrivateKey().length, 32)
assert.equal(wallet.getAddress()[0], 0)
assert.equal(wallet.getAddress()[1] >>> 4, 0)
})
it('should generate an account with 000 prefix (string)', function () {
var wallet = Wallet.generateVanityAddress('^000')
assert.equal(wallet.getPrivateKey().length, 32)
assert.equal(wallet.getAddress()[0], 0)
assert.equal(wallet.getAddress()[1] >>> 4, 0)
})
})
describe('.getV3Filename()', function () {