Skip to content

Commit

Permalink
Remove genesis hash call from cluster provider (#258)
Browse files Browse the repository at this point in the history
It turns out that nothing uses the `genesisHash` that we fetch on every
page as part of the cluster provider. Deleting code is the best way to
refactor it :)
  • Loading branch information
mcintyre94 authored Jul 7, 2023
1 parent 280a929 commit 06305bf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/providers/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface ClusterInfo {
firstAvailableBlock: number;
epochSchedule: EpochSchedule;
epochInfo: EpochInfo;
genesisHash: string;
}

type Dispatch = (action: Action) => void;
Expand Down Expand Up @@ -117,11 +116,10 @@ async function updateCluster(dispatch: Dispatch, cluster: Cluster, customUrl: st
new URL(customUrl);

const connection = new Connection(clusterUrl(cluster, customUrl));
const [firstAvailableBlock, epochSchedule, epochInfo, genesisHash] = await Promise.all([
const [firstAvailableBlock, epochSchedule, epochInfo] = await Promise.all([
connection.getFirstAvailableBlock(),
connection.getEpochSchedule(),
connection.getEpochInfo(),
connection.getGenesisHash(),
]);

dispatch({
Expand All @@ -130,7 +128,6 @@ async function updateCluster(dispatch: Dispatch, cluster: Cluster, customUrl: st
epochInfo,
epochSchedule,
firstAvailableBlock,
genesisHash,
},
customUrl,
status: ClusterStatus.Connected,
Expand Down

1 comment on commit 06305bf

@vercel
Copy link

@vercel vercel bot commented on 06305bf Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.