Remove suspicious toHuman in author extraction (#7542)
This commit is contained in:
parent
cd96fe032c
commit
64889009b7
@ -3,6 +3,7 @@
|
||||
|
||||
import type { HeaderExtended } from '@polkadot/api-derive/types';
|
||||
import type { EraRewardPoints } from '@polkadot/types/interfaces';
|
||||
import type { Codec } from '@polkadot/types/types';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
@ -68,10 +69,7 @@ function BlockAuthorsBase ({ children }: Props): React.ReactElement<Props> {
|
||||
thisBlockAuthor = lastHeader.author.toString();
|
||||
} else if (isAuthorMappingWithDeposit && (hasConsensusDigest || hasPreRuntimeDigest)) { // Check for a Digest
|
||||
// Some blockchains such as Moonbeam need to fetch the author accountId from a mapping
|
||||
thisBlockAuthor = ((await api.query.authorMapping.mappingWithDeposit(hasConsensusDigest ? lastHeader.digest.logs[0].asConsensus[1] : lastHeader.digest.logs[0].asPreRuntime[1])).toHuman() as {
|
||||
account: string;
|
||||
deposit: string;
|
||||
}).account;
|
||||
thisBlockAuthor = (await api.query.authorMapping.mappingWithDeposit<{ account: Codec } & Codec>(hasConsensusDigest ? lastHeader.digest.logs[0].asConsensus[1] : lastHeader.digest.logs[0].asPreRuntime[1])).account.toString();
|
||||
lastHeader.authorFromMapping = thisBlockAuthor;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user