Skip to content

Commit

Permalink
hotfix: explorer temporary disable vote instruction card (#15596)
Browse files Browse the repository at this point in the history
  • Loading branch information
oJshua authored Mar 1, 2021
1 parent aee7012 commit 24af996
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 8 additions & 6 deletions explorer/src/components/instruction/vote/VoteDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ export function VoteDetailsCard(props: {
</td>
</tr>

<tr>
<td>Timestamp</td>
<td className="text-lg-right text-monospace">
{displayTimestamp(info.vote.timestamp * 1000)}
</td>
</tr>
{info.vote.timestamp && (
<tr>
<td>Timestamp</td>
<td className="text-lg-right text-monospace">
{displayTimestamp(info.vote.timestamp * 1000)}
</td>
</tr>
)}

<tr>
<td>Slots</td>
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/components/instruction/vote/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-redeclare */

import { array, number, pick, string, StructType } from "superstruct";
import { array, number, optional, pick, string, StructType } from "superstruct";
import { Pubkey } from "validators/pubkey";

export type VoteInfo = StructType<typeof VoteInfo>;
Expand All @@ -12,6 +12,6 @@ export const VoteInfo = pick({
vote: pick({
hash: string(),
slots: array(number()),
timestamp: number(),
timestamp: optional(number()),
}),
});
7 changes: 3 additions & 4 deletions explorer/src/components/transaction/InstructionsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
useTransactionStatus,
} from "providers/transactions";
import { Cluster, useCluster } from "providers/cluster";
import { VoteDetailsCard } from "components/instruction/vote/VoteDetailsCard";
// import { VoteDetailsCard } from "components/instruction/vote/VoteDetailsCard";
import { UpgradeableBpfLoaderDetailsCard } from "components/instruction/upgradeable-bpf-loader/UpgradeableBpfLoaderDetailsCard";

export function InstructionsSection({ signature }: SignatureProps) {
Expand Down Expand Up @@ -171,9 +171,8 @@ function renderInstructionCard({
return <StakeDetailsCard {...props} />;
case "spl-memo":
return <MemoDetailsCard {...props} />;
case "vote":
console.log(props);
return <VoteDetailsCard {...props} />;
/*case "vote":
return <VoteDetailsCard {...props} />;*/
default:
return <UnknownDetailsCard {...props} />;
}
Expand Down

0 comments on commit 24af996

Please sign in to comment.