diff --git a/apps/explorer/src/app/components/txs/details/proposal/proposal-status-icon.tsx b/apps/explorer/src/app/components/txs/details/proposal/proposal-status-icon.tsx
index 7ec3692f8..7e4f696c5 100644
--- a/apps/explorer/src/app/components/txs/details/proposal/proposal-status-icon.tsx
+++ b/apps/explorer/src/app/components/txs/details/proposal/proposal-status-icon.tsx
@@ -64,7 +64,7 @@ export function getIconAndLabelForStatus(
};
case 'STATE_FAILED':
return {
- icon: 'ban-circle',
+ icon: 'thumbs-down',
label: t('Proposal became invalid and was not processed'),
};
case 'STATE_OPEN':
@@ -82,8 +82,8 @@ export function getIconAndLabelForStatus(
};
case 'STATE_REJECTED':
return {
- icon: 'thumbs-down',
- label: t('Voting is complete and this proposal was rejected'),
+ icon: 'disable',
+ label: t('The proposal was invalid'),
};
case 'STATE_WAITING_FOR_NODE_VOTE':
return {
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle-new.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle-new.tsx
new file mode 100644
index 000000000..483d312f6
--- /dev/null
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle-new.tsx
@@ -0,0 +1,42 @@
+import { Loader } from '@vegaprotocol/ui-toolkit';
+import { BundleError } from './signature-bundle/bundle-error';
+import { BundleExists } from './signature-bundle/bundle-exists';
+import { useExplorerNewAssetSignatureBundleQuery } from './__generated__/SignatureBundle';
+
+export interface ProposalSignatureBundleByTypeProps {
+ id: string;
+}
+
+/**
+ * If a proposal needs a signature bundle, AND that signature bundle exists
+ * AND that proposal is a New Asset Proposal, render an overview of the
+ * signature bundle. Or an error.
+ *
+ * There is an almost identical component, ProposalSignatureBundleUpdateAsset
+ */
+export const ProposalSignatureBundleNewAsset = ({
+ id,
+}: ProposalSignatureBundleByTypeProps) => {
+ const { data, error, loading } = useExplorerNewAssetSignatureBundleQuery({
+ variables: {
+ id,
+ },
+ });
+
+ if (loading) {
+ return ;
+ }
+
+ if (data?.erc20ListAssetBundle?.signatures) {
+ return (
+
+ );
+ } else {
+ return ;
+ }
+};
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle-update.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle-update.tsx
new file mode 100644
index 000000000..290a37d11
--- /dev/null
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle-update.tsx
@@ -0,0 +1,39 @@
+import { Loader } from '@vegaprotocol/ui-toolkit';
+import type { ProposalSignatureBundleByTypeProps } from './signature-bundle-new';
+import { BundleError } from './signature-bundle/bundle-error';
+import { BundleExists } from './signature-bundle/bundle-exists';
+import { useExplorerUpdateAssetSignatureBundleQuery } from './__generated__/SignatureBundle';
+
+/**
+ * If a proposal needs a signature bundle, AND that signature bundle exists
+ * AND that proposal is a Asset Limits Proposal, render an overview of the
+ * signature bundle. Or an error.
+ *
+ * There is an almost identical component, ProposalSignatureBundleNewAsset
+ */
+export const ProposalSignatureBundleUpdateAsset = ({
+ id,
+}: ProposalSignatureBundleByTypeProps) => {
+ const { data, error, loading } = useExplorerUpdateAssetSignatureBundleQuery({
+ variables: {
+ id,
+ },
+ });
+
+ if (loading) {
+ return ;
+ }
+
+ if (data?.erc20SetAssetLimitsBundle?.signatures) {
+ return (
+
+ );
+ } else {
+ return ;
+ }
+};
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle.tsx
index bd2f11489..6f8e7d3d6 100644
--- a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle.tsx
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle.tsx
@@ -1,10 +1,5 @@
-import { Icon } from '@vegaprotocol/ui-toolkit';
-import ProposalLink from '../../../links/proposal-link/proposal-link';
-import {
- useExplorerNewAssetSignatureBundleQuery,
- useExplorerUpdateAssetSignatureBundleQuery,
-} from './__generated__/SignatureBundle';
-import { t } from '@vegaprotocol/i18n';
+import { ProposalSignatureBundleNewAsset } from './signature-bundle-new';
+import { ProposalSignatureBundleUpdateAsset } from './signature-bundle-update';
export function format(date: string | undefined, def: string) {
if (!date) {
@@ -20,92 +15,17 @@ interface ProposalSignatureBundleProps {
}
/**
- * Some proposals, if enacted, generate a signature bundle
+ * Some proposals, if enacted, generate a signature bundle.
+ * The queries have to be split due to the way the API returns
+ * errors, hence this slightly redundant feeling switcher.
*/
export const ProposalSignatureBundle = ({
id,
type,
}: ProposalSignatureBundleProps) => {
- return type == 'NewAsset' ? (
+ return type === 'NewAsset' ? (
) : (
);
};
-
-interface ProposalSignatureBundleByTypeProps {
- id: string;
-}
-
-export const ProposalSignatureBundleNewAsset = ({
- id,
-}: ProposalSignatureBundleByTypeProps) => {
- const { data, error, loading } = useExplorerNewAssetSignatureBundleQuery({
- variables: {
- id,
- },
- });
-
- if (data?.erc20ListAssetBundle?.signatures) {
- return (
-
-
-
{t('Signature bundle generated')}
- {data.asset?.status}
-
-
- See details
-
-
-
{t('Signatures')}
-
-
-
-
-
{t('Nonce')}
-
-
-
-
-
-
-
-
-
-
- );
- } else {
- return null;
- }
-};
-
-export const ProposalSignatureBundleUpdateAsset = ({
- id,
-}: ProposalSignatureBundleByTypeProps) => {
- const { data, error, loading } = useExplorerUpdateAssetSignatureBundleQuery({
- variables: {
- id,
- },
- });
-
- if (data?.erc20SetAssetLimitsBundle?.signatures) {
- return {data.erc20SetAssetLimitsBundle.signatures}
;
- } else {
- return null;
- }
-};
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-error.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-error.tsx
new file mode 100644
index 000000000..8165258b1
--- /dev/null
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-error.tsx
@@ -0,0 +1,34 @@
+import type { ApolloError } from '@apollo/client';
+import type { AssetStatus } from '@vegaprotocol/types';
+
+import { t } from '@vegaprotocol/i18n';
+import Hash from '../../../../links/hash';
+import { IconForBundleStatus } from './bundle-icon';
+
+export interface BundleErrorProps {
+ status?: AssetStatus;
+ error?: ApolloError;
+}
+
+/**
+ * Renders if a proposal signature bundle cannot be found.
+ * It is also possible that a data node has dropped the bundle
+ * from its retention so there is a backup case where we check
+ * the status - if it's already enabled, pretend this isn't an error
+ */
+export const BundleError = ({ status, error }: BundleErrorProps) => {
+ return (
+
+
+
{t('No signature bundle found')}
+
+
+ {status === 'STATUS_ENABLED' ? (
+ t('Asset already enabled')
+ ) : (
+
+ )}
+
+
+ );
+};
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-exists.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-exists.tsx
new file mode 100644
index 000000000..da0792e23
--- /dev/null
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-exists.tsx
@@ -0,0 +1,46 @@
+import { t } from '@vegaprotocol/i18n';
+import type { AssetStatus } from '@vegaprotocol/types';
+import ProposalLink from '../../../../links/proposal-link/proposal-link';
+import { IconForBundleStatus } from './bundle-icon';
+import { ProposalSignatureBundleDetails } from './details';
+
+export interface BundleExistsProps {
+ signatures: string;
+ nonce: string;
+ status?: AssetStatus;
+ proposalId: string;
+}
+
+/**
+ * If a proposal needs a signature bundle, AND that signature bundle exists,
+ * this component renders that signature bundle.
+ *
+ */
+export const BundleExists = ({
+ signatures,
+ nonce,
+ status,
+ proposalId,
+}: BundleExistsProps) => {
+ return (
+
+
+
+ {status === 'STATUS_ENABLED'
+ ? t('Asset added to bridge')
+ : t('Signature bundle generated')}
+
+
+
+
+ {status !== 'STATUS_ENABLED' ? (
+
+
+
+ ) : null}
+
+ );
+};
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-icon.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-icon.tsx
new file mode 100644
index 000000000..d5f80dcaf
--- /dev/null
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/bundle-icon.tsx
@@ -0,0 +1,20 @@
+import type { AssetStatus } from '@vegaprotocol/types';
+import type { IconName } from '@vegaprotocol/ui-toolkit';
+import { Icon } from '@vegaprotocol/ui-toolkit';
+
+export interface IconForBundleStatusProps {
+ status?: AssetStatus;
+}
+
+/**
+ * Naively select an icon for an asset. If it is enabled, we show a tick - anything
+ * else is assumed to be 'in progress'. There should only be a signature bundle or the
+ * asset should not exist
+ *
+ * @param param0
+ * @returns
+ */
+export const IconForBundleStatus = ({ status }: IconForBundleStatusProps) => {
+ const i: IconName = status === 'STATUS_ENABLED' ? 'tick-circle' : 'clean';
+ return ;
+};
diff --git a/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/details.tsx b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/details.tsx
new file mode 100644
index 000000000..d594eb849
--- /dev/null
+++ b/apps/explorer/src/app/components/txs/details/proposal/signature-bundle/details.tsx
@@ -0,0 +1,41 @@
+import { t } from '@vegaprotocol/i18n';
+
+export interface ProposalSignatureBundleDetailsProps {
+ signatures: string;
+ nonce: string;
+}
+
+export const ProposalSignatureBundleDetails = ({
+ signatures,
+ nonce,
+}: ProposalSignatureBundleDetailsProps) => {
+ return (
+
+ {t('Signature bundle details')}
+
+
+
{t('Signatures')}
+
+
+
+
+
{t('Nonce')}
+
+
+
+
+
+ );
+};