Skip to content

Commit

Permalink
common: rename resolveGrafting function to discoverGraftBases
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Oct 24, 2023
1 parent a6ce65c commit 1867f41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/indexer-common/src/__tests__/grafting.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolveGrafting, GraftableSubgraph } from '../grafting'
import { discoverGraftBases, GraftableSubgraph } from '../grafting'
import { SubgraphDeploymentID } from '@graphprotocol/common-ts'

// Create a mock for the fetchSubgraphManifest function
Expand Down Expand Up @@ -38,7 +38,7 @@ describe('resolveGrafting', () => {
test('should resolve grafting with multiple iterations', async () => {
const targetDeployment = new SubgraphDeploymentID(target)

const result: GraftableSubgraph[] = await resolveGrafting(
const result: GraftableSubgraph[] = await discoverGraftBases(
fakeSubgraphManifestResolver,
targetDeployment,
)
Expand All @@ -64,7 +64,7 @@ describe('resolveGrafting', () => {
test('should resolve grafting when max iterations are reached', async () => {
const targetDeployment = new SubgraphDeploymentID(target)
expect(() =>
resolveGrafting(
discoverGraftBases(
fakeSubgraphManifestResolver,
targetDeployment,
2, // Set maxIterations to 2
Expand Down
4 changes: 2 additions & 2 deletions packages/indexer-common/src/grafting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ interface SubgraphGraftStatus extends GraftableSubgraph {
indexingStatus: IndexingStatus | null
}

// Resolves all graft dependencies for a given subgraph
export async function resolveGrafting(
// Discovers all graft dependencies for a given subgraph
export async function discoverGraftBases(
subgraphManifestResolver: SubgraphManifestResolver,
targetDeployment: SubgraphDeploymentID,
maxIterations: number = 100,
Expand Down

0 comments on commit 1867f41

Please sign in to comment.