Restore Account from JSON with Appropriate crypto type (#117)

* json restore with appropriate crypto type

* check if array
This commit is contained in:
YJ
2019-04-17 19:29:30 +02:00
committed by GitHub
parent 7bfb98d43c
commit f558b2ec48
+2 -1
View File
@@ -201,8 +201,9 @@ export class Keyring extends Base implements KeyringStruct {
}
restoreAccount (json: KeyringPair$Json, password: string): KeyringPair {
const type = Array.isArray(json.encoding.content) ? json.encoding.content[1] : 'ed25519';
const pair = createPair(
this.keyring.type,
type,
{
// FIXME Just for the transition period (ignoreChecksum)
publicKey: this.decodeAddress(json.address, true)