Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tricky-keys-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensnode/ponder-metadata": minor
---

Updated terminology to replace `network` with `chain`.
18 changes: 9 additions & 9 deletions apps/ensadmin/src/components/ensnode/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ export function useIndexingStatusQuery(
* @throws Error if the response is invalid
*/
function validateResponse(response: EnsNode.Metadata) {
const { networkIndexingStatusByChainId } = response.runtime;
const { chainIndexingStatuses } = response.runtime;

if (typeof networkIndexingStatusByChainId === "undefined") {
throw new Error(`Network indexing status not found in the response.`);
if (typeof chainIndexingStatuses === "undefined") {
throw new Error(`Chain indexing status not found in the response.`);
}

if (Object.keys(networkIndexingStatusByChainId).length === 0) {
throw new Error(`No network indexing status found response.`);
if (Object.keys(chainIndexingStatuses).length === 0) {
throw new Error(`No chain indexing status found response.`);
}

const networksWithoutFirstBlockToIndex = Object.entries(networkIndexingStatusByChainId).filter(
([, network]) => network.firstBlockToIndex === null,
const chainsWithoutFirstBlockToIndex = Object.entries(chainIndexingStatuses).filter(
([, chain]) => chain.firstBlockToIndex === null,
);

if (networksWithoutFirstBlockToIndex.length > 0) {
if (chainsWithoutFirstBlockToIndex.length > 0) {
throw new Error(
`Missing first block to index for some networks with the following chain IDs: ${networksWithoutFirstBlockToIndex
`Missing first block to index for some chains with the following chain IDs: ${chainsWithoutFirstBlockToIndex
.map(([chainId]) => chainId)
.join(", ")}`,
);
Expand Down
4 changes: 2 additions & 2 deletions apps/ensadmin/src/components/ensnode/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export namespace EnsNode {
export type BlockInfo = PonderMetadata.BlockInfo;

/**
* Network indexing status for a chain.
* Indexing status for a chain.
*/
export type NetworkIndexingStatus = PonderMetadata.NetworkIndexingStatus;
export type ChainIndexingStatus = PonderMetadata.ChainIndexingStatus;
}
Loading