Filter extrinsics from system events (re-apply) (#2707)

This commit is contained in:
Jaco Greeff 2020-05-08 12:00:42 +02:00 committed by GitHub
parent 02dcf17257
commit 8bf82af539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,8 +28,8 @@ function BlockByHash ({ className, value }: Props): React.ReactElement<Props> {
const events = useCall<KeyedEvent[]>(api.query.system.events.at, [value], {
isSingle: true,
transform: (events: EventRecord[]): KeyedEvent[] =>
events.map((record) => ({
key: `${Date.now()}-${record.hash.toHex()}`,
events.map((record, index) => ({
key: `${Date.now()}-${index}-${record.hash.toHex()}`,
record
}))
});
@ -87,7 +87,7 @@ function BlockByHash ({ className, value }: Props): React.ReactElement<Props> {
<Column>
<Events
eventClassName='explorer--BlockByHash-block'
events={events}
events={events?.filter(({ record: { phase } }) => !phase.isApplyExtrinsic)}
label={t('system events')}
/>
</Column>