Don't decode on unlocked
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user