feat(explorer): add protocol upgrade view (#2802)
This commit is contained in:
parent
c4b38cc0dc
commit
b1a7a22bf9
@ -6,3 +6,4 @@ NX_VEGA_ENV=STAGNET3
|
|||||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||||
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
|
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
|
||||||
NX_VEGA_GOVERNANCE_URL=https://stagnet3.token.vega.xyz
|
NX_VEGA_GOVERNANCE_URL=https://stagnet3.token.vega.xyz
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega-dev-releases/releases/
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { t } from '@vegaprotocol/react-helpers';
|
import { t } from '@vegaprotocol/react-helpers';
|
||||||
import React from 'react';
|
|
||||||
import { StatusMessage } from '../status-message';
|
import { StatusMessage } from '../status-message';
|
||||||
|
|
||||||
interface RenderFetchedProps {
|
interface RenderFetchedProps {
|
||||||
|
@ -0,0 +1,62 @@
|
|||||||
|
import { t } from '@vegaprotocol/react-helpers';
|
||||||
|
import { TxDetailsShared } from './shared/tx-details-shared';
|
||||||
|
import { TableCell, TableRow, TableWithTbody } from '../../table';
|
||||||
|
import { BlockLink } from '../../links';
|
||||||
|
import { StatusMessage } from '../../status-message';
|
||||||
|
import { ENV } from '../../../config/env';
|
||||||
|
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
|
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
|
||||||
|
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
|
||||||
|
import type { components } from '../../../../types/explorer';
|
||||||
|
|
||||||
|
interface TxDetailsProtocolUpgradeProps {
|
||||||
|
txData: BlockExplorerTransactionResult | undefined;
|
||||||
|
pubKey: string | undefined;
|
||||||
|
blockData: TendermintBlocksResponse | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validator event: Protocol Upgrade proposal
|
||||||
|
*/
|
||||||
|
export const TxDetailsProtocolUpgrade = ({
|
||||||
|
txData,
|
||||||
|
pubKey,
|
||||||
|
blockData,
|
||||||
|
}: TxDetailsProtocolUpgradeProps) => {
|
||||||
|
if (!txData) {
|
||||||
|
return <>{t('Awaiting Block Explorer transaction details')}</>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const upgrade: components['schemas']['v1ProtocolUpgradeProposal'] =
|
||||||
|
txData.command.protocolUpgradeProposal;
|
||||||
|
|
||||||
|
if (!upgrade || !upgrade.upgradeBlockHeight || !upgrade.vegaReleaseTag) {
|
||||||
|
return (
|
||||||
|
<StatusMessage>{t('Invalid upgrade proposal format')}</StatusMessage>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const urlBase = ENV.dataSources.vegaRepoUrl;
|
||||||
|
const release = upgrade.vegaReleaseTag;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableWithTbody className="mb-8">
|
||||||
|
<TxDetailsShared txData={txData} pubKey={pubKey} blockData={blockData} />
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Upgrade at block')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<BlockLink height={upgrade.upgradeBlockHeight} />
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Upgrade to')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<ExternalLink href={`${urlBase}${release}`}>
|
||||||
|
{upgrade.vegaReleaseTag}
|
||||||
|
</ExternalLink>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableWithTbody>
|
||||||
|
);
|
||||||
|
};
|
@ -19,6 +19,7 @@ import { TxDetailsLiquidityAmendment } from './tx-liquidity-amend';
|
|||||||
import { TxDetailsLiquidityCancellation } from './tx-liquidity-cancel';
|
import { TxDetailsLiquidityCancellation } from './tx-liquidity-cancel';
|
||||||
import { TxDetailsDataSubmission } from './tx-data-submission';
|
import { TxDetailsDataSubmission } from './tx-data-submission';
|
||||||
import { TxProposalVote } from './tx-proposal-vote';
|
import { TxProposalVote } from './tx-proposal-vote';
|
||||||
|
import { TxDetailsProtocolUpgrade } from './tx-details-protocol-upgrade';
|
||||||
|
|
||||||
interface TxDetailsWrapperProps {
|
interface TxDetailsWrapperProps {
|
||||||
txData: BlockExplorerTransactionResult | undefined;
|
txData: BlockExplorerTransactionResult | undefined;
|
||||||
@ -70,6 +71,8 @@ function getTransactionComponent(txData?: BlockExplorerTransactionResult) {
|
|||||||
return TxDetailsOrder;
|
return TxDetailsOrder;
|
||||||
case 'Submit Oracle Data':
|
case 'Submit Oracle Data':
|
||||||
return TxDetailsDataSubmission;
|
return TxDetailsDataSubmission;
|
||||||
|
case 'Protocol Upgrade':
|
||||||
|
return TxDetailsProtocolUpgrade;
|
||||||
case 'Cancel Order':
|
case 'Cancel Order':
|
||||||
return TxDetailsOrderCancel;
|
return TxDetailsOrderCancel;
|
||||||
case 'Amend Order':
|
case 'Amend Order':
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { t } from '@vegaprotocol/react-helpers';
|
import { t } from '@vegaprotocol/react-helpers';
|
||||||
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
|
|
||||||
import { MarketLink } from '../../links';
|
import { MarketLink } from '../../links';
|
||||||
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
|
|
||||||
import { TxDetailsShared } from './shared/tx-details-shared';
|
import { TxDetailsShared } from './shared/tx-details-shared';
|
||||||
import { TableCell, TableRow, TableWithTbody } from '../../table';
|
import { TableCell, TableRow, TableWithTbody } from '../../table';
|
||||||
|
|
||||||
import type { components } from '../../../../types/explorer';
|
import type { components } from '../../../../types/explorer';
|
||||||
|
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
|
||||||
|
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
|
||||||
|
|
||||||
export type LiquidityCancellation =
|
export type LiquidityCancellation =
|
||||||
components['schemas']['v1LiquidityProvisionCancellation'];
|
components['schemas']['v1LiquidityProvisionCancellation'];
|
||||||
|
@ -10,6 +10,7 @@ const truthy = ['1', 'true'];
|
|||||||
export const ENV = {
|
export const ENV = {
|
||||||
// Data sources
|
// Data sources
|
||||||
// Environment
|
// Environment
|
||||||
|
env: windowOrDefault('NX_VEGA_ENV'),
|
||||||
dsn: windowOrDefault('NX_EXPLORER_SENTRY_DSN'),
|
dsn: windowOrDefault('NX_EXPLORER_SENTRY_DSN'),
|
||||||
dataSources: {
|
dataSources: {
|
||||||
blockExplorerUrl: windowOrDefault('NX_BLOCK_EXPLORER'),
|
blockExplorerUrl: windowOrDefault('NX_BLOCK_EXPLORER'),
|
||||||
@ -17,6 +18,7 @@ export const ENV = {
|
|||||||
tendermintWebsocketUrl: windowOrDefault('NX_TENDERMINT_WEBSOCKET_URL'),
|
tendermintWebsocketUrl: windowOrDefault('NX_TENDERMINT_WEBSOCKET_URL'),
|
||||||
ethExplorerUrl: windowOrDefault('NX_ETHERSCAN_URL'),
|
ethExplorerUrl: windowOrDefault('NX_ETHERSCAN_URL'),
|
||||||
governanceUrl: windowOrDefault('NX_VEGA_GOVERNANCE_URL'),
|
governanceUrl: windowOrDefault('NX_VEGA_GOVERNANCE_URL'),
|
||||||
|
vegaRepoUrl: windowOrDefault('NX_VEGA_REPO_URL'),
|
||||||
},
|
},
|
||||||
flags: {
|
flags: {
|
||||||
assets: truthy.includes(windowOrDefault('NX_EXPLORER_ASSETS')),
|
assets: truthy.includes(windowOrDefault('NX_EXPLORER_ASSETS')),
|
||||||
|
@ -8,3 +8,4 @@ NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"
|
|||||||
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
@ -9,6 +9,7 @@ NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
|||||||
NX_VEGA_URL=http://localhost:3028/query
|
NX_VEGA_URL=http://localhost:3028/query
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
|
||||||
NX_ETH_LOCAL_PROVIDER_URL=http://localhost:8545/
|
NX_ETH_LOCAL_PROVIDER_URL=http://localhost:8545/
|
||||||
NX_ETH_WALLET_MNEMONIC="ozone access unlock valid olympic save include omit supply green clown session"
|
NX_ETH_WALLET_MNEMONIC="ozone access unlock valid olympic save include omit supply green clown session"
|
@ -8,3 +8,4 @@ NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"
|
|||||||
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega-dev-releases/releases
|
||||||
|
@ -7,3 +7,4 @@ NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\",\"TESTNET\":\"h
|
|||||||
NX_VEGA_TOKEN_URL=https://token.vega.xyz
|
NX_VEGA_TOKEN_URL=https://token.vega.xyz
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
@ -8,3 +8,4 @@ NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"
|
|||||||
NX_VEGA_TOKEN_URL=https://mainnet-mirror.token.vega.xyz
|
NX_VEGA_TOKEN_URL=https://mainnet-mirror.token.vega.xyz
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
@ -7,3 +7,4 @@ NX_VEGA_NETWORKS={\"DEVNET\":\"https://dev.token.vega.xyz\",\"STAGNET3\":\"https
|
|||||||
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/sandbox-network.json
|
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/sandbox-network.json
|
||||||
NX_VEGA_EXPLORER_URL=https://sandbox.explorer.vega.xyz
|
NX_VEGA_EXPLORER_URL=https://sandbox.explorer.vega.xyz
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
@ -8,3 +8,4 @@ NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"
|
|||||||
NX_VEGA_TOKEN_URL=https://stagnet1.token.vega.xyz
|
NX_VEGA_TOKEN_URL=https://stagnet1.token.vega.xyz
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
@ -8,3 +8,4 @@ NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"
|
|||||||
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega-dev-releases/releases
|
||||||
|
@ -8,3 +8,4 @@ NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"
|
|||||||
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
|
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||||
|
Loading…
Reference in New Issue
Block a user