diff --git a/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.test.ts b/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.test.ts index 68384040..7c1c6c18 100644 --- a/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.test.ts +++ b/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.test.ts @@ -46,7 +46,7 @@ describe(OAppDefaultConfigurationRepository.name, () => { }) describe( - OAppDefaultConfigurationRepository.prototype.findBySourceChain.name, + OAppDefaultConfigurationRepository.prototype.getBySourceChain.name, () => { it('returns only records with matching source chain', async () => { const record1 = mockRecord({ @@ -61,7 +61,7 @@ describe(OAppDefaultConfigurationRepository.name, () => { await repository.addMany([record1, record2, record3]) - const result = await repository.findBySourceChain(ChainId.ETHEREUM) + const result = await repository.getBySourceChain(ChainId.ETHEREUM) expect(result.length).toEqual(1) }) diff --git a/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.ts b/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.ts index 643b55ee..7e132012 100644 --- a/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.ts +++ b/packages/backend/src/peripherals/database/OAppDefaultConfigurationRepository.ts @@ -41,7 +41,7 @@ export class OAppDefaultConfigurationRepository extends BaseRepository { return rows.map(toRecord) } - public async findBySourceChain( + public async getBySourceChain( sourceChainId: ChainId, ): Promise { const knex = await this.knex() diff --git a/packages/backend/src/peripherals/database/OAppRepository.test.ts b/packages/backend/src/peripherals/database/OAppRepository.test.ts index a977a53a..cecc65e1 100644 --- a/packages/backend/src/peripherals/database/OAppRepository.test.ts +++ b/packages/backend/src/peripherals/database/OAppRepository.test.ts @@ -20,18 +20,18 @@ describe(OAppRepository.name, () => { await repository.addMany([record1, record2]) - const recordsBeforeMerge = await repository.findAll() + const recordsBeforeMerge = await repository.getAll() await repository.addMany([record1, record2]) - const recordsAfterMerge = await repository.findAll() + const recordsAfterMerge = await repository.getAll() expect(recordsBeforeMerge.length).toEqual(2) expect(recordsAfterMerge.length).toEqual(2) }) }) - describe(OAppRepository.prototype.findBySourceChain.name, () => { + describe(OAppRepository.prototype.getBySourceChain.name, () => { it('returns only records with matching source chain', async () => { const record1 = mockRecord({ id: 1, @@ -51,7 +51,7 @@ describe(OAppRepository.name, () => { await repository.addMany([record1, record2, record3]) - const result = await repository.findBySourceChain(ChainId.ETHEREUM) + const result = await repository.getBySourceChain(ChainId.ETHEREUM) expect(result.length).toEqual(1) }) diff --git a/packages/backend/src/peripherals/database/OAppRepository.ts b/packages/backend/src/peripherals/database/OAppRepository.ts index d17bd17d..71cdc9f5 100644 --- a/packages/backend/src/peripherals/database/OAppRepository.ts +++ b/packages/backend/src/peripherals/database/OAppRepository.ts @@ -43,7 +43,7 @@ export class OAppRepository extends BaseRepository { return ids.map((id) => id.id) } - public async findAll(): Promise { + public async getAll(): Promise { const knex = await this.knex() const rows = await knex('oapp').select('*') @@ -51,9 +51,7 @@ export class OAppRepository extends BaseRepository { return rows.map(toRecord) } - public async findBySourceChain( - sourceChainId: ChainId, - ): Promise { + public async getBySourceChain(sourceChainId: ChainId): Promise { const knex = await this.knex() const rows = await knex('oapp') diff --git a/packages/backend/src/tracking/domain/indexers/OAppConfigurationIndexer.ts b/packages/backend/src/tracking/domain/indexers/OAppConfigurationIndexer.ts index 2780022a..331bbbfb 100644 --- a/packages/backend/src/tracking/domain/indexers/OAppConfigurationIndexer.ts +++ b/packages/backend/src/tracking/domain/indexers/OAppConfigurationIndexer.ts @@ -24,7 +24,7 @@ export class OAppConfigurationIndexer extends ChildIndexer { } protected override async update(_from: number, to: number): Promise { - const oApps = await this.oAppRepo.findBySourceChain(this.chainId) + const oApps = await this.oAppRepo.getBySourceChain(this.chainId) const configurationRecords = await Promise.all( oApps.map(async (oApp) => { diff --git a/packages/backend/src/tracking/http/TrackingController.test.ts b/packages/backend/src/tracking/http/TrackingController.test.ts index 4b89804e..5350f3c1 100644 --- a/packages/backend/src/tracking/http/TrackingController.test.ts +++ b/packages/backend/src/tracking/http/TrackingController.test.ts @@ -23,7 +23,7 @@ describe(TrackingController.name, () => { const oAppConfigRepo = mockObject({}) const oAppDefaultConfigRepo = mockObject({ - findBySourceChain: () => Promise.resolve([]), + getBySourceChain: () => Promise.resolve([]), }) const controller = new TrackingController( @@ -104,7 +104,7 @@ describe(TrackingController.name, () => { ] const oAppRepo = mockObject({ - findBySourceChain: () => Promise.resolve([oAppA, oAppB]), + getBySourceChain: () => Promise.resolve([oAppA, oAppB]), }) const oAppConfigRepo = mockObject({ @@ -112,7 +112,7 @@ describe(TrackingController.name, () => { }) const oAppDefaultConfigRepo = mockObject({ - findBySourceChain: (chainId) => + getBySourceChain: (chainId) => Promise.resolve([ { sourceChainId: chainId, diff --git a/packages/backend/src/tracking/http/TrackingController.ts b/packages/backend/src/tracking/http/TrackingController.ts index 908bf2b6..4234ede1 100644 --- a/packages/backend/src/tracking/http/TrackingController.ts +++ b/packages/backend/src/tracking/http/TrackingController.ts @@ -31,13 +31,13 @@ class TrackingController { async getOApps(chainId: ChainId): Promise { const defaultConfigurations = - await this.oAppDefaultConfigRepo.findBySourceChain(chainId) + await this.oAppDefaultConfigRepo.getBySourceChain(chainId) if (defaultConfigurations.length === 0) { return null } - const oApps = await this.oAppRepo.findBySourceChain(chainId) + const oApps = await this.oAppRepo.getBySourceChain(chainId) if (oApps.length === 0) { return null