chore(trading): update governance variables (#4766)
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
This commit is contained in:
parent
e3c6dd41c9
commit
01ca05a313
@ -33,7 +33,7 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
|
|||||||
const { params } = useNetworkParams([
|
const { params } = useNetworkParams([
|
||||||
NetworkParams.governance_proposal_market_requiredMajority,
|
NetworkParams.governance_proposal_market_requiredMajority,
|
||||||
]);
|
]);
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
const requiredMajorityPercentage = useMemo(() => {
|
const requiredMajorityPercentage = useMemo(() => {
|
||||||
const requiredMajority =
|
const requiredMajority =
|
||||||
params?.governance_proposal_market_requiredMajority ?? 1;
|
params?.governance_proposal_market_requiredMajority ?? 1;
|
||||||
|
@ -35,7 +35,7 @@ export const BundleSigners = ({
|
|||||||
tx,
|
tx,
|
||||||
id,
|
id,
|
||||||
}: BundleSignersProps) => {
|
}: BundleSignersProps) => {
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
|
|
||||||
const bridgeFunction: BridgeFunction =
|
const bridgeFunction: BridgeFunction =
|
||||||
tx?.changes?.erc20 && 'contractAddress' in tx.changes.erc20
|
tx?.changes?.erc20 && 'contractAddress' in tx.changes.erc20
|
||||||
|
@ -139,7 +139,7 @@ export const ValidatorsPage = () => {
|
|||||||
const [vegaDialog, setVegaDialog] = useState<boolean>(false);
|
const [vegaDialog, setVegaDialog] = useState<boolean>(false);
|
||||||
const [tmDialog, setTmDialog] = useState<boolean>(false);
|
const [tmDialog, setTmDialog] = useState<boolean>(false);
|
||||||
|
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -21,8 +21,8 @@ export const MarketsPage = () => {
|
|||||||
updateTitle: store.updateTitle,
|
updateTitle: store.updateTitle,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const governanceLink = useLinks(DApp.Governance);
|
||||||
const externalLink = tokenLink(TOKEN_NEW_MARKET_PROPOSAL);
|
const externalLink = governanceLink(TOKEN_NEW_MARKET_PROPOSAL);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateTitle(titlefy(['Markets']));
|
updateTitle(titlefy(['Markets']));
|
||||||
|
@ -29,7 +29,7 @@ export const MarketSuccessorProposalBanner = ({
|
|||||||
?.successorConfiguration?.parentMarketId === marketId
|
?.successorConfiguration?.parentMarketId === marketId
|
||||||
) ?? [];
|
) ?? [];
|
||||||
const [visible, setVisible] = useState(true);
|
const [visible, setVisible] = useState(true);
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
if (visible && successors.length) {
|
if (visible && successors.length) {
|
||||||
return (
|
return (
|
||||||
<NotificationBanner
|
<NotificationBanner
|
||||||
|
@ -186,7 +186,7 @@ const NavbarMenu = ({ onClick }: { onClick: () => void }) => {
|
|||||||
</NavbarLink>
|
</NavbarLink>
|
||||||
</NavbarItem>
|
</NavbarItem>
|
||||||
<NavbarItem>
|
<NavbarItem>
|
||||||
<NavbarLinkExternal to={useLinks(DApp.Token)()}>
|
<NavbarLinkExternal to={useLinks(DApp.Governance)()}>
|
||||||
{t('Governance')}
|
{t('Governance')}
|
||||||
</NavbarLinkExternal>
|
</NavbarLinkExternal>
|
||||||
</NavbarItem>
|
</NavbarItem>
|
||||||
|
@ -41,7 +41,7 @@ export const ProposedMarkets = () => {
|
|||||||
proposal.terms.change.instrument.code,
|
proposal.terms.change.instrument.code,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
return useMemo(
|
return useMemo(
|
||||||
() => (
|
() => (
|
||||||
<div className="mt-7 pt-8 border-t border-default">
|
<div className="mt-7 pt-8 border-t border-default">
|
||||||
|
@ -87,7 +87,7 @@ export const NetworkSwitcher = ({
|
|||||||
className,
|
className,
|
||||||
}: NetworkSwitcherProps) => {
|
}: NetworkSwitcherProps) => {
|
||||||
const { VEGA_ENV, VEGA_NETWORKS } = useEnvironment();
|
const { VEGA_ENV, VEGA_NETWORKS } = useEnvironment();
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
const [isOpen, setOpen] = useState(false);
|
const [isOpen, setOpen] = useState(false);
|
||||||
const [isAdvancedView, setAdvancedView] = useState(false);
|
const [isAdvancedView, setAdvancedView] = useState(false);
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ type Net = Exclude<Networks, 'CUSTOM'>;
|
|||||||
export enum DApp {
|
export enum DApp {
|
||||||
Explorer = 'Explorer',
|
Explorer = 'Explorer',
|
||||||
Console = 'Console',
|
Console = 'Console',
|
||||||
Token = 'Token',
|
Governance = 'Governance',
|
||||||
}
|
}
|
||||||
|
|
||||||
type DAppLinks = {
|
type DAppLinks = {
|
||||||
@ -45,7 +45,7 @@ const ConsoleLinks = {
|
|||||||
[Networks.MAINNET_MIRROR]: 'https://console.mainnet-mirror.vega.rocks',
|
[Networks.MAINNET_MIRROR]: 'https://console.mainnet-mirror.vega.rocks',
|
||||||
};
|
};
|
||||||
|
|
||||||
const TokenLinks = {
|
const GovernanceLinks = {
|
||||||
...EmptyLinks,
|
...EmptyLinks,
|
||||||
[Networks.DEVNET]: 'https://dev.governance.vega.xyz',
|
[Networks.DEVNET]: 'https://dev.governance.vega.xyz',
|
||||||
[Networks.STAGNET1]: 'https://governance.stagnet1.vega.rocks',
|
[Networks.STAGNET1]: 'https://governance.stagnet1.vega.rocks',
|
||||||
@ -59,7 +59,7 @@ const TokenLinks = {
|
|||||||
const Links: { [k in DApp]: DAppLinks } = {
|
const Links: { [k in DApp]: DAppLinks } = {
|
||||||
[DApp.Explorer]: ExplorerLinks,
|
[DApp.Explorer]: ExplorerLinks,
|
||||||
[DApp.Console]: ConsoleLinks,
|
[DApp.Console]: ConsoleLinks,
|
||||||
[DApp.Token]: TokenLinks,
|
[DApp.Governance]: GovernanceLinks,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DocsLinks = VEGA_DOCS_URL
|
export const DocsLinks = VEGA_DOCS_URL
|
||||||
@ -88,7 +88,7 @@ export const useLinks = (dapp: DApp, network?: Net) => {
|
|||||||
useEnvironment();
|
useEnvironment();
|
||||||
const fallback = {
|
const fallback = {
|
||||||
[DApp.Explorer]: VEGA_EXPLORER_URL,
|
[DApp.Explorer]: VEGA_EXPLORER_URL,
|
||||||
[DApp.Token]: VEGA_TOKEN_URL,
|
[DApp.Governance]: VEGA_TOKEN_URL,
|
||||||
[DApp.Console]: VEGA_CONSOLE_URL,
|
[DApp.Console]: VEGA_CONSOLE_URL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -99,7 +99,10 @@ export const useLinks = (dapp: DApp, network?: Net) => {
|
|||||||
|
|
||||||
let baseUrl = trim(Links[dapp][net], '/');
|
let baseUrl = trim(Links[dapp][net], '/');
|
||||||
if (baseUrl.length === 0 && Object.keys(fallback).includes(dapp)) {
|
if (baseUrl.length === 0 && Object.keys(fallback).includes(dapp)) {
|
||||||
baseUrl = trim(fallback[dapp as DApp.Explorer | DApp.Token] || '', '/');
|
baseUrl = trim(
|
||||||
|
fallback[dapp as DApp.Explorer | DApp.Governance] || '',
|
||||||
|
'/'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const link = useCallback(
|
const link = useCallback(
|
||||||
@ -134,7 +137,7 @@ export const TOKEN_VALIDATOR = '/validators/:id';
|
|||||||
* Generates link to the protocol upgrade proposal details on Governance
|
* Generates link to the protocol upgrade proposal details on Governance
|
||||||
*/
|
*/
|
||||||
export const useProtocolUpgradeProposalLink = () => {
|
export const useProtocolUpgradeProposalLink = () => {
|
||||||
const governance = useLinks(DApp.Token);
|
const governance = useLinks(DApp.Governance);
|
||||||
return (releaseTag: string, blockHeight: string) =>
|
return (releaseTag: string, blockHeight: string) =>
|
||||||
governance(
|
governance(
|
||||||
TOKEN_PROTOCOL_UPGRADE_PROPOSAL.replace(
|
TOKEN_PROTOCOL_UPGRADE_PROPOSAL.replace(
|
||||||
|
@ -277,7 +277,7 @@ const SuccessionLineItem = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const marketData = data?.market;
|
const marketData = data?.market;
|
||||||
const governanceLink = useLinks(DApp.Token);
|
const governanceLink = useLinks(DApp.Governance);
|
||||||
const proposalLink = marketData?.proposal?.id
|
const proposalLink = marketData?.proposal?.id
|
||||||
? governanceLink(TOKEN_PROPOSAL.replace(':id', marketData?.proposal?.id))
|
? governanceLink(TOKEN_PROPOSAL.replace(':id', marketData?.proposal?.id))
|
||||||
: undefined;
|
: undefined;
|
||||||
|
@ -10,7 +10,7 @@ type AssetProposalNotificationProps = {
|
|||||||
export const AssetProposalNotification = ({
|
export const AssetProposalNotification = ({
|
||||||
assetId,
|
assetId,
|
||||||
}: AssetProposalNotificationProps) => {
|
}: AssetProposalNotificationProps) => {
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
const { data: proposal } = useUpdateProposal({
|
const { data: proposal } = useUpdateProposal({
|
||||||
id: assetId,
|
id: assetId,
|
||||||
proposalType: Schema.ProposalType.TYPE_UPDATE_ASSET,
|
proposalType: Schema.ProposalType.TYPE_UPDATE_ASSET,
|
||||||
|
@ -10,7 +10,7 @@ type MarketProposalNotificationProps = {
|
|||||||
export const MarketProposalNotification = ({
|
export const MarketProposalNotification = ({
|
||||||
marketId,
|
marketId,
|
||||||
}: MarketProposalNotificationProps) => {
|
}: MarketProposalNotificationProps) => {
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
const { data: proposal } = useUpdateProposal({
|
const { data: proposal } = useUpdateProposal({
|
||||||
id: marketId,
|
id: marketId,
|
||||||
proposalType: Schema.ProposalType.TYPE_UPDATE_MARKET,
|
proposalType: Schema.ProposalType.TYPE_UPDATE_MARKET,
|
||||||
|
@ -9,7 +9,7 @@ import { t } from '@vegaprotocol/i18n';
|
|||||||
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
||||||
|
|
||||||
export const ProposalActionsDropdown = ({ id }: { id: string }) => {
|
export const ProposalActionsDropdown = ({ id }: { id: string }) => {
|
||||||
const linkCreator = useLinks(DApp.Token);
|
const linkCreator = useLinks(DApp.Governance);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionsDropdown data-testid="proposal-actions-content">
|
<ActionsDropdown data-testid="proposal-actions-content">
|
||||||
|
@ -26,7 +26,7 @@ const UpdateNetworkParameterToastContent = ({
|
|||||||
}: {
|
}: {
|
||||||
proposal: Proposal;
|
proposal: Proposal;
|
||||||
}) => {
|
}) => {
|
||||||
const tokenLink = useLinks(DApp.Token);
|
const tokenLink = useLinks(DApp.Governance);
|
||||||
const change = proposal.terms.change as UpdateNetworkParameter;
|
const change = proposal.terms.change as UpdateNetworkParameter;
|
||||||
const title = t('Network change proposal %s').replace(
|
const title = t('Network change proposal %s').replace(
|
||||||
'%s',
|
'%s',
|
||||||
|
Loading…
Reference in New Issue
Block a user