Skip to content

Commit

Permalink
Merge pull request #240 from Psychedelic/hotfix/stringify-indentity
Browse files Browse the repository at this point in the history
Hotfix stringify identity
  • Loading branch information
tomiir authored Oct 28, 2022
2 parents eadc90d + e2838d0 commit ace5fce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"typescript": "^4.5"
},
"name": "@psychedelic/plug-controller",
"version": "0.24.5",
"version": "0.24.6",
"description": "Internet Computer Plug wallet's controller",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/constants/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const PLUG_CONTROLLER_VERSION = "0.24.5";
export const PLUG_CONTROLLER_VERSION = "0.24.6";
9 changes: 8 additions & 1 deletion src/utils/storage/update_handlers/v0.20.0.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { createAccountFromMnemonic } from '../../../utils/account';
import { Types } from '../../../utils/account/constants';
import Secp256k1KeyIdentity from '../../identity/secpk256k1/identity';

const getKeyPair = (identity: Secp256k1KeyIdentity) => {
const jsonIdentity = identity.toJSON();
return typeof jsonIdentity === 'string'
? jsonIdentity
: JSON.stringify(jsonIdentity);
}

export default (storage: any) => {
const mnemonic = storage.mnemonic;
Expand All @@ -14,7 +21,7 @@ export default (storage: any) => {
return ({
...wallet,
type: Types.mnemonic,
keyPair: identity.toJSON(),
keyPair: getKeyPair(identity),
})
})
}
Expand Down

0 comments on commit ace5fce

Please sign in to comment.