Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 9344503

Browse files
committed
Added test for generateVanityAddress() with string contructor
1 parent 8a5ff24 commit 9344503

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,18 @@ describe('.generate()', function () {
119119
})
120120

121121
describe('.generateVanityAddress()', function () {
122-
it('should generate an account with 000 prefix', function () {
122+
it('should generate an account with 000 prefix (object)', function () {
123123
var wallet = Wallet.generateVanityAddress(/^000/)
124124
assert.equal(wallet.getPrivateKey().length, 32)
125125
assert.equal(wallet.getAddress()[0], 0)
126126
assert.equal(wallet.getAddress()[1] >>> 4, 0)
127127
})
128+
it('should generate an account with 000 prefix (string)', function () {
129+
var wallet = Wallet.generateVanityAddress('^000')
130+
assert.equal(wallet.getPrivateKey().length, 32)
131+
assert.equal(wallet.getAddress()[0], 0)
132+
assert.equal(wallet.getAddress()[1] >>> 4, 0)
133+
})
128134
})
129135

130136
describe('.getV3Filename()', function () {

0 commit comments

Comments
 (0)