Allow author extract from empty (#1761)
This commit is contained in:
@@ -79,10 +79,12 @@ export default class ConsensusEngineId extends U32 {
|
||||
* @description From the input bytes, decode into an author
|
||||
*/
|
||||
public extractAuthor (bytes: Bytes, sessionValidators: AccountId[]): AccountId | undefined {
|
||||
if (this.isAura) {
|
||||
return this.getAuraAuthor(bytes, sessionValidators);
|
||||
} else if (this.isBabe) {
|
||||
return this.getBabeAuthor(bytes, sessionValidators);
|
||||
if (sessionValidators?.length) {
|
||||
if (this.isAura) {
|
||||
return this.getAuraAuthor(bytes, sessionValidators);
|
||||
} else if (this.isBabe) {
|
||||
return this.getBabeAuthor(bytes, sessionValidators);
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user