Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: support keychain without pass #3212

Merged
merged 9 commits into from
Aug 10, 2020
Prev Previous commit
Next Next commit
fix: support keychain without pass
jacobheun committed Aug 5, 2020
commit fa4376401073b3a220c0a5ddf3f40a0df4e13950
16 changes: 14 additions & 2 deletions packages/ipfs/test/core/init.spec.js
Original file line number Diff line number Diff line change
@@ -37,6 +37,18 @@ describe('init', function () {
afterEach(() => repo.teardown())

it('should init successfully', async () => {
await ipfs.init({ bits: 512 })

const res = await repo.exists()
expect(res).to.equal(true)

const config = await repo.config.getAll()

expect(config.Identity).to.exist()
expect(config.Keychain).to.exist()
})

it('should init successfully with a keychain pass', async () => {
await ipfs.init({ bits: 512, pass: nanoid() })

const res = await repo.exists()
@@ -69,7 +81,7 @@ describe('init', function () {
it('should set # of bits in key', async function () {
this.timeout(40 * 1000)

await ipfs.init({ bits: 1024, pass: nanoid() })
await ipfs.init({ bits: 1024 })

const config = await repo.config.getAll()
expect(config.Identity.PrivKey.length).is.above(256)
@@ -97,7 +109,7 @@ describe('init', function () {
})

it('should write init docs', async () => {
await ipfs.init({ bits: 512, pass: nanoid() })
await ipfs.init({ bits: 512 })
const multihash = 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB'

const node = await ipfs.object.get(multihash, { enc: 'base58' })
6 changes: 1 addition & 5 deletions packages/ipfs/test/core/key-exchange.spec.js
Original file line number Diff line number Diff line change
@@ -14,11 +14,7 @@ describe('key exchange', function () {
const passwordPem = nanoid()

before(async () => {
ipfs = (await df.spawn({
ipfsOptions: {
pass: nanoid()
}
})).api
ipfs = (await df.spawn()).api
})

after(() => df.clean())