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

Commit e95b314

Browse files
committed
Add tests for .generate()
1 parent 4cf1f60 commit e95b314

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ describe('.getChecksumAddressString()', function () {
4646
})
4747
})
4848

49+
describe('.generate()', function () {
50+
it('should generate an account', function () {
51+
assert.equal(Wallet.generate().getPrivateKey().length, 32)
52+
})
53+
it('should generate an account compatible with ICAP Direct', function () {
54+
var wallet = Wallet.generate(true)
55+
assert.equal(wallet.getPrivateKey().length, 32)
56+
assert.equal(wallet.getAddress()[0], 0)
57+
})
58+
})
59+
4960
describe('.toV3()', function () {
5061
var salt = new Buffer('dc9e4a98886738bd8aae134a1f89aaa5a502c3fbd10e336136d4d5fe47448ad6', 'hex')
5162
var iv = new Buffer('cecacd85e9cb89788b5aab2f93361233', 'hex')

0 commit comments

Comments
 (0)