Don't decode on unlocked

This commit is contained in:
Jaco Greeff
2020-09-25 17:06:04 +02:00
parent 2fc078d994
commit 30198d1a6d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ Changes:
- Use cross-environment TextDecoder & TextEncoder from the polkadot-js polyfills
- Add `isBase{32, 58, 64}` to `@polkadot/util-crypto`
- Add `base64{Pad, Trim}` to add/remove padding characters
- Add `createFromJsonjson)` to keyring (create pair without adding)
- Add `createFromJson(json)` to keyring (create pair without adding)
## 3.4.1 Aug 31, 2020
+1 -1
View File
@@ -110,7 +110,7 @@ export default function createPair ({ toSS58, type }: Setup, { publicKey, secret
};
const recode = (passphrase?: string): Uint8Array => {
isLocked(secretKey) && decodePkcs8(passphrase, encoded);
isLocked(secretKey) && encoded && decodePkcs8(passphrase, encoded);
encoded = encode({ publicKey, secretKey }, passphrase); // re-encode, latest version
encTypes = undefined; // swap to defaults, latest version follows