mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-13 07:31:07 +00:00
Adapt interfaces for latest @polkadot/keyring (#146)
* Adapt interfaces for latest @polkadot/keyring * Re-write yarn.lock * Bump latest api
This commit is contained in:
@@ -58,11 +58,11 @@ export default class Base {
|
||||
return this._genesisHash;
|
||||
}
|
||||
|
||||
decodeAddress (key: string | Uint8Array, ignoreChecksum?: boolean): Uint8Array {
|
||||
decodeAddress = (key: string | Uint8Array, ignoreChecksum?: boolean): Uint8Array => {
|
||||
return this.keyring.decodeAddress(key, ignoreChecksum);
|
||||
}
|
||||
|
||||
encodeAddress (key: string | Uint8Array): string {
|
||||
encodeAddress = (key: string | Uint8Array): string => {
|
||||
return this.keyring.encodeAddress(key);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ export default class Base {
|
||||
|
||||
getPairs (): Array<KeyringPair> {
|
||||
return this.keyring.getPairs().filter((pair: KeyringPair) =>
|
||||
env.isDevelopment() || pair.getMeta().isTesting !== true
|
||||
env.isDevelopment() || pair.meta.isTesting !== true
|
||||
);
|
||||
}
|
||||
|
||||
@@ -116,19 +116,14 @@ export default class Base {
|
||||
protected addAccountPairs (): void {
|
||||
this.keyring
|
||||
.getPairs()
|
||||
.forEach((pair: KeyringPair) => {
|
||||
const address = pair.address();
|
||||
|
||||
this.accounts.add(this._store, address, {
|
||||
address,
|
||||
meta: pair.getMeta()
|
||||
});
|
||||
.forEach(({ address, meta }: KeyringPair) => {
|
||||
this.accounts.add(this._store, address, { address, meta });
|
||||
});
|
||||
}
|
||||
|
||||
protected addTimestamp (pair: KeyringPair): void {
|
||||
if (!pair.getMeta().whenCreated) {
|
||||
pair.setMeta({ whenCreated: Date.now() });
|
||||
if (!pair.meta.whenCreated) {
|
||||
pair.setMeta({ whenCreated: Date.now() });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user