Skip to content

Commit

Permalink
revert: allow clone
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejborstnik committed Apr 2, 2024
1 parent 25a4f96 commit 6cee39e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions features/keychain/module/__tests__/lock-private-keys.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ describe('lockPrivateKeys', () => {
expect(!!exportedKeys.publicKey).toBe(true)
})

it('should allow clone when locked', async () => {
const keychain = createKeychain({ seed })
keychain.lockPrivateKeys()
keychain.clone()
})

it('should allow exportKeys after lock/unlock', async () => {
const keychain = createKeychain({ seed })
keychain.lockPrivateKeys()
Expand Down Expand Up @@ -125,12 +131,6 @@ describe('lockPrivateKeys', () => {
await expect(keychain.signTx({})).rejects.toThrow(/private keys are locked/)
})

it('should block clone when locked', async () => {
const keychain = createKeychain({ seed })
keychain.lockPrivateKeys()
await expect(async () => keychain.clone()).rejects.toThrow(/private keys are locked/)
})

it('should block sodium when locked', async () => {
const keychain = createKeychain({ seed })
keychain.lockPrivateKeys()
Expand Down
1 change: 0 additions & 1 deletion features/keychain/module/keychain.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ export class Keychain {
}

clone() {
this.#assertPrivateKeysUnlocked()
return new Keychain({ legacyPrivToPub: this.#legacyPrivToPub })
}

Expand Down

0 comments on commit 6cee39e

Please sign in to comment.