@@ -3,67 +3,14 @@ import { useTranslation } from 'react-i18next'
33import { ConsensusEvent , ConsensusEventType } from '../../../oasis-nexus/api'
44import { ConsensusScope } from '../../../types/searchScope'
55import { TransactionLink } from '../Transactions/TransactionLink'
6- import { TFunction } from 'i18next'
7- import { exhaustedTypeWarning } from '../../../types/errors'
86import { MethodIcon } from '../ConsensusTransactionMethod'
97import { ArrowRight , CopyCheck , LogOut } from 'lucide-react'
108import { StyledDescriptionList } from '../StyledDescriptionList'
119import { AccountLink } from '../Account/AccountLink'
1210import { getPreciseNumberFormat } from '../../../locales/getPreciseNumberFormat'
1311import { getTokensForScope } from '../../../config'
1412import { RoundedBalance } from '../RoundedBalance'
15-
16- export const getConsensusEventTypeLabel = ( t : TFunction , type : ConsensusEventType | undefined ) : string => {
17- switch ( type ) {
18- case 'governance.proposal_executed' :
19- return t ( 'consensusEvent.governanceProposalExecuted' )
20- case 'governance.proposal_finalized' :
21- return t ( 'consensusEvent.governanceProposalFinalized' )
22- case 'governance.proposal_submitted' :
23- return t ( 'consensusEvent.governanceProposalSubmitted' )
24- case 'governance.vote' :
25- return t ( 'consensusEvent.governanceVote' )
26- case 'registry.entity' :
27- return t ( 'consensusEvent.registryEntity' )
28- case 'registry.node' :
29- return t ( 'consensusEvent.registryNode' )
30- case 'registry.node_unfrozen' :
31- return t ( 'consensusEvent.registryNodeUnfrozen' )
32- case 'registry.runtime' :
33- return t ( 'consensusEvent.registryRuntime' )
34- case 'registry.runtime_suspended' :
35- return t ( 'consensusEvent.registryRuntimeSuspended' )
36- case 'roothash.execution_discrepancy' :
37- return t ( 'consensusEvent.roothashExecution_discrepancy' )
38- case 'roothash.executor_committed' :
39- return t ( 'consensusEvent.roothashExecutorCommitted' )
40- case 'roothash.finalized' :
41- return t ( 'consensusEvent.roothashFinalized' )
42- case 'roothash.in_msg_processed' :
43- return t ( 'consensusEvent.roothashInMsgProcessed' )
44- case 'roothash.message' :
45- return t ( 'consensusEvent.roothashMessage' )
46- case 'staking.allowance_change' :
47- return t ( 'consensusEvent.stakingAllowanceChange' )
48- case 'staking.burn' :
49- return t ( 'consensusEvent.stakingBurn' )
50- case 'staking.escrow.add' :
51- return t ( 'consensusEvent.stakingEscrowAdd' )
52- case 'staking.escrow.debonding_start' :
53- return t ( 'consensusEvent.stakingEscrowDebondingStart' )
54- case 'staking.escrow.reclaim' :
55- return t ( 'consensusEvent.stakingEscrowReclaim' )
56- case 'staking.escrow.take' :
57- return t ( 'consensusEvent.stakingEscrowTake' )
58- case 'staking.transfer' :
59- return t ( 'consensusEvent.stakingTransfer' )
60- case undefined :
61- return t ( 'common.unknown' )
62- default :
63- exhaustedTypeWarning ( 'Unexpected event type' , type )
64- return type
65- }
66- }
13+ import { getConsensusEventTypeLabel } from './helpers'
6714
6815const ConsensusEventDetailsContent : FC < {
6916 event : ConsensusEvent
0 commit comments