Adapted to display moonbeam author (#3108)

* adapted to display moonbeam author

* refactor and lint

* removed comments
This commit is contained in:
Antoine Estienne
2021-01-25 18:16:41 +01:00
committed by GitHub
parent af36e3a52c
commit f6bb200146
2 changed files with 15 additions and 8 deletions
@@ -88,6 +88,10 @@ export class GenericConsensusEngineId extends u32 {
return this.registry.createType('AccountId', bytes);
}
private _getH160Author (bytes: Bytes): AccountId {
return this.registry.createType('AccountId', bytes);
}
/**
* @description From the input bytes, decode into an author
*/
@@ -104,6 +108,11 @@ export class GenericConsensusEngineId extends u32 {
return this._getPowAuthor(bytes);
}
// Moonbeam is neither Aura nor Babe nor Pow and uses h160 addresses
if (bytes.length === 20) {
return this._getH160Author(bytes);
}
return undefined;
}