Internal ss58Format handling (#283)

This commit is contained in:
Jaco Greeff
2020-02-18 17:07:53 +01:00
committed by GitHub
parent 826de3ddf0
commit 2ba4444ca4
4 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
},
"devDependencies": {
"@polkadot/keyring": "^2.4.1",
"@polkadot/types": "^1.3.1",
"@polkadot/types": "^1.4.0-beta.5",
"@polkadot/util": "^2.4.1",
"@types/ledgerhq__hw-transport-node-hid": "^4.21.1",
"@types/ledgerhq__hw-transport-u2f": "^4.21.1",
+5 -5
View File
@@ -30,8 +30,6 @@ export default class Base {
protected _store!: KeyringStore;
private _ss58Format?: Prefix;
constructor () {
this._accounts = accounts;
this._addresses = addresses;
@@ -96,8 +94,10 @@ export default class Base {
return password.length > 0 && password.length <= MAX_PASS_LEN;
}
public setSS58Format (ss58Format: Prefix): void {
this._ss58Format = ss58Format;
public setSS58Format (ss58Format?: Prefix): void {
if (this._keyring && ss58Format) {
this._keyring.setSS58Format(ss58Format);
}
}
public setDevMode (isDevelopment: boolean): void {
@@ -105,7 +105,7 @@ export default class Base {
}
protected initKeyring (options: KeyringOptions): void {
const keyring = testKeyring({ ss58Format: this._ss58Format, ...options }, true);
const keyring = testKeyring(options, true);
if (isBoolean(options.isDevelopment)) {
this.setDevMode(options.isDevelopment);