From 6befb60877dbef2abaf20577a4774e95b0273677 Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Fri, 10 Jan 2025 15:43:52 +0100 Subject: [PATCH] Add missing consensus tx method names --- .../ConsensusTransactionMethod/index.tsx | 90 +++++++++++++------ src/locales/en/translation.json | 23 +++++ 2 files changed, 84 insertions(+), 29 deletions(-) diff --git a/src/app/components/ConsensusTransactionMethod/index.tsx b/src/app/components/ConsensusTransactionMethod/index.tsx index 0a5ed53b1d..7efccccc81 100644 --- a/src/app/components/ConsensusTransactionMethod/index.tsx +++ b/src/app/components/ConsensusTransactionMethod/index.tsx @@ -172,30 +172,9 @@ const MethodIconWithTruncatedLabel: FC = props => { } const getConsensusTransactionLabel = (t: TFunction, method: ConsensusTxMethod | undefined): string => { - /** - * TODO: Missing values: - * - * consensusMeta - * keymanagerPublishEphemeralSecret - * keymanagerPublishMasterSecret - * keymanagerUpdatePolicy - * registryDeregisterEntity - * registryProveFreshness - * registryUnfreezeNode - * roothashEvidence - * roothashSubmitMsg - * stakingBurn - * keymanager/churpApply - * keymanager/churpConfirm - * keymanager/churpCreate - * keymanager/churpUpdate - * vaultAuthorizeAction - * vaultCancelAction - * vaultCreate - */ - // Please note: when updating this, keep it in sync // with the knownConsensusTxMethods array below! + switch (method) { case ConsensusTxMethod.stakingTransfer: return t('transactions.method.stakingTransfer') @@ -229,28 +208,81 @@ const getConsensusTransactionLabel = (t: TFunction, method: ConsensusTxMethod | return t('transactions.method.beaconPVSSReveal') case ConsensusTxMethod.beaconVRFProve: return t('transactions.method.beaconVRFProve') + case ConsensusTxMethod.consensusMeta: + return t('transactions.method.consensus.meta') + case ConsensusTxMethod.keymanagerPublishEphemeralSecret: + return t('transactions.method.keyManager.publishEphemeralSecret') + case ConsensusTxMethod.keymanagerPublishMasterSecret: + return t('transactions.method.keyManager.publishMasterSecret') + case ConsensusTxMethod.keymanagerUpdatePolicy: + return t('transactions.method.keyManager.updatePolicy') + case ConsensusTxMethod['keymanager/churpApply']: + return t('transactions.method.keyManager.churp.apply') + case ConsensusTxMethod['keymanager/churpConfirm']: + return t('transactions.method.keyManager.churp.confirm') + case ConsensusTxMethod['keymanager/churpCreate']: + return t('transactions.method.keyManager.churp.create') + case ConsensusTxMethod['keymanager/churpUpdate']: + return t('transactions.method.keyManager.churp.update') + case ConsensusTxMethod.registryDeregisterEntity: + return t('transactions.method.registryDeregisterEntity') + case ConsensusTxMethod.registryProveFreshness: + return t('transactions.method.registryProveFreshness') + case ConsensusTxMethod.registryUnfreezeNode: + return t('transactions.method.registryUnfreezeNode') + case ConsensusTxMethod.roothashEvidence: + return t('transactions.method.roothashEvidence') + case ConsensusTxMethod.roothashSubmitMsg: + return t('transactions.method.roothashSubmitMessage') + case ConsensusTxMethod.stakingBurn: + return t('transactions.method.stakingBurn') + case ConsensusTxMethod.vaultAuthorizeAction: + return t('transactions.method.vault.authorizeAction') + case ConsensusTxMethod.vaultCancelAction: + return t('transactions.method.vault.cancelAction') + case ConsensusTxMethod.vaultCreate: + return t('transactions.method.vault.create') default: return method || t('common.unknown') } } +// List of known consensus ts types, do offer in filter +// Please keep them in alphabetical order const knownConsensusTxMethods: ConsensusTxMethod[] = [ - ConsensusTxMethod.stakingTransfer, - ConsensusTxMethod.stakingAddEscrow, - ConsensusTxMethod.stakingReclaimEscrow, - ConsensusTxMethod.stakingAmendCommissionSchedule, ConsensusTxMethod.stakingAllow, + ConsensusTxMethod.stakingAmendCommissionSchedule, + ConsensusTxMethod.governanceCastVote, + ConsensusTxMethod.stakingBurn, + ConsensusTxMethod.consensusMeta, ConsensusTxMethod.stakingWithdraw, + ConsensusTxMethod.registryDeregisterEntity, ConsensusTxMethod.roothashExecutorCommit, ConsensusTxMethod.roothashExecutorProposerTimeout, + ConsensusTxMethod['keymanager/churpApply'], + ConsensusTxMethod['keymanager/churpConfirm'], + ConsensusTxMethod['keymanager/churpCreate'], + ConsensusTxMethod['keymanager/churpUpdate'], + ConsensusTxMethod.keymanagerPublishEphemeralSecret, + ConsensusTxMethod.keymanagerPublishMasterSecret, + ConsensusTxMethod.keymanagerUpdatePolicy, + ConsensusTxMethod.beaconPVSSCommit, + ConsensusTxMethod.beaconPVSSReveal, ConsensusTxMethod.registryRegisterEntity, ConsensusTxMethod.registryRegisterNode, ConsensusTxMethod.registryRegisterRuntime, - ConsensusTxMethod.governanceCastVote, + ConsensusTxMethod.registryProveFreshness, + ConsensusTxMethod.registryUnfreezeNode, + ConsensusTxMethod.roothashEvidence, + ConsensusTxMethod.roothashSubmitMsg, + ConsensusTxMethod.stakingAddEscrow, + ConsensusTxMethod.stakingReclaimEscrow, ConsensusTxMethod.governanceSubmitProposal, - ConsensusTxMethod.beaconPVSSCommit, - ConsensusTxMethod.beaconPVSSReveal, + ConsensusTxMethod.stakingTransfer, ConsensusTxMethod.beaconVRFProve, + ConsensusTxMethod.vaultAuthorizeAction, + ConsensusTxMethod.vaultCancelAction, + ConsensusTxMethod.vaultCreate, ] export const getConsensusTxMethodOptions = (t: TFunction): SelectOptionBase[] => diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 8bd34a3bb5..8615a2af30 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -422,14 +422,20 @@ "filterByType": "Filter by type", "latest": "Latest Transactions", "method": { + "stakingBurn": "Burn", "stakingTransfer": "Transfer", "stakingAddEscrow": "Start Delegate", "stakingReclaimEscrow": "Start Undelegate", "stakingAmendCommissionSchedule": "Amend Commission Schedule", "stakingAllow": "Allowance Change", "stakingWithdraw": "Continued Delegate", + "registryDeregisterEntity": "Deregister Entity", + "registryUnfreezeNode": "Registry: Unfreeze Node", "roothashExecutorCommit": "Executor Commit", + "roothashEvidence": "RootHash Evidence", + "roothashSubmitMessage": "RootHash: Submit Message", "roothashExecutorProposerTimeout": "Executor Proposer Timeout", + "registryProveFreshness": "Registry: Prove Freshness", "registryRegisterEntity": "Register Entity", "registryRegisterNode": "Register Node", "registryRegisterRuntime": "Register Runtime", @@ -445,6 +451,7 @@ "consensus": { "deposit": "Consensus Deposit", "delegate": "Consensus Delegate", + "meta": "Consensus Meta", "undelegate": "Consensus Undelegate", "withdraw": "Consensus Withdraw" }, @@ -452,11 +459,27 @@ "call": "Contract Call", "create": "Contract Creation" }, + "keyManager": { + "churp": { + "apply": "Key Manager: Churp Apply", + "confirm": "Key Manager: Churp Confirm", + "create": "Key Manager: Churp Create", + "update": "Key Manager: Churp Update", + }, + "publishEphemeralSecret": "Key Manager: Publish Ephemeral Secret", + "publishMasterSecret": "Key Manager: Publish Master Secret", + "updatePolicy": "Key Manager: Update Policy" + }, "rofl": { "create": "ROFL Create", "register": "ROFL Register", "remove": "ROFL Remove", "update": "ROFL Update" + }, + "vault": { + "authorizeAction": "Vault: Authorize Action", + "cancelAction": "Vault: Cancel Action", + "create": "Vault: Create" } } },