diff --git a/.env.sample b/.env.sample index a42173faa5..f0433eb229 100644 --- a/.env.sample +++ b/.env.sample @@ -159,7 +159,6 @@ #FF_TWAPS_DECODING= # Targeted Messaging -#FF_TARGETED_MESSAGING= #TARGETED_MESSAGING_FILE_STORAGE_TYPE= # Community @@ -174,5 +173,4 @@ #STAKING_API_KEY= # Targeted Messaging -#FF_TARGETED_MESSAGING= #TARGETED_MESSAGING_FILE_STORAGE_TYPE= diff --git a/src/app.module.e2e-spec.ts b/src/app.module.e2e-spec.ts index 594103fb86..0afa00054e 100644 --- a/src/app.module.e2e-spec.ts +++ b/src/app.module.e2e-spec.ts @@ -7,6 +7,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Application bootstrap', () => { it('should init the app', async () => { @@ -20,6 +22,8 @@ describe('Application bootstrap', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/app.module.ts b/src/app.module.ts index 749898b9cc..09e0d5da2e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -72,7 +72,6 @@ export class AppModule implements NestModule { email: isEmailFeatureEnabled, delegatesV2: isDelegatesV2Enabled, pushNotifications: isPushNotificationsEnabled, - targetedMessaging: isTargetedMessagingFeatureEnabled, } = configFactory()['features']; return { @@ -108,7 +107,7 @@ export class AppModule implements NestModule { RootModule, SafeAppsModule, SafesModule, - ...(isTargetedMessagingFeatureEnabled ? [TargetedMessagingModule] : []), + TargetedMessagingModule, TransactionsModule, TransactionsViewControllerModule, // common diff --git a/src/config/entities/__tests__/configuration.ts b/src/config/entities/__tests__/configuration.ts index 2d7f515adc..91e6c998ed 100644 --- a/src/config/entities/__tests__/configuration.ts +++ b/src/config/entities/__tests__/configuration.ts @@ -146,7 +146,6 @@ export default (): ReturnType => ({ pushNotifications: false, nativeStaking: false, nativeStakingDecoding: false, - targetedMessaging: false, improvedAddressPoisoning: false, }, httpClient: { requestTimeout: faker.number.int() }, diff --git a/src/config/entities/configuration.ts b/src/config/entities/configuration.ts index 7557a1ff39..54684996ac 100644 --- a/src/config/entities/configuration.ts +++ b/src/config/entities/configuration.ts @@ -227,8 +227,6 @@ export default () => ({ nativeStaking: process.env.FF_NATIVE_STAKING?.toLowerCase() === 'true', nativeStakingDecoding: process.env.FF_NATIVE_STAKING_DECODING?.toLowerCase() === 'true', - targetedMessaging: - process.env.FF_TARGETED_MESSAGING?.toLowerCase() === 'true', improvedAddressPoisoning: process.env.FF_IMPROVED_ADDRESS_POISONING?.toLowerCase() === 'true', }, diff --git a/src/datasources/targeted-messaging/targeted-messaging.datasource.ts b/src/datasources/targeted-messaging/targeted-messaging.datasource.ts index b495845ee5..9633b2b5fd 100644 --- a/src/datasources/targeted-messaging/targeted-messaging.datasource.ts +++ b/src/datasources/targeted-messaging/targeted-messaging.datasource.ts @@ -23,9 +23,14 @@ import { SubmissionNotFoundError } from '@/domain/targeted-messaging/errors/subm import { TargetedSafeNotFoundError } from '@/domain/targeted-messaging/errors/targeted-safe-not-found.error'; import { ILoggingService, LoggingService } from '@/logging/logging.interface'; import { asError } from '@/logging/utils'; -import { Inject, UnprocessableEntityException } from '@nestjs/common'; +import { + Inject, + Injectable, + UnprocessableEntityException, +} from '@nestjs/common'; import postgres from 'postgres'; +@Injectable() export class TargetedMessagingDatasource implements ITargetedMessagingDatasource { diff --git a/src/routes/about/__tests__/get-about.e2e-spec.ts b/src/routes/about/__tests__/get-about.e2e-spec.ts index 2184182f4c..1882789227 100644 --- a/src/routes/about/__tests__/get-about.e2e-spec.ts +++ b/src/routes/about/__tests__/get-about.e2e-spec.ts @@ -1,17 +1,19 @@ import '@/__tests__/matchers/to-be-string-or-null'; import { AppModule } from '@/app.module'; import { CacheKeyPrefix } from '@/datasources/cache/constants'; +import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; +import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; +import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; +import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import { expect } from '@jest/globals'; import type { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import type { Server } from 'net'; import request from 'supertest'; -import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; -import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; -import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; -import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; -import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; -import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; describe('Get about e2e test', () => { let app: INestApplication; @@ -27,6 +29,8 @@ describe('Get about e2e test', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/routes/accounts/accounts.controller.spec.ts b/src/routes/accounts/accounts.controller.spec.ts index b37304267c..892cc454a6 100644 --- a/src/routes/accounts/accounts.controller.spec.ts +++ b/src/routes/accounts/accounts.controller.spec.ts @@ -17,6 +17,8 @@ import { TestNetworkModule } from '@/datasources/network/__tests__/test.network. import { NetworkModule } from '@/datasources/network/network.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import { accountDataSettingBuilder } from '@/domain/accounts/entities/__tests__/account-data-setting.builder'; import { accountDataTypeBuilder } from '@/domain/accounts/entities/__tests__/account-data-type.builder'; import { accountBuilder } from '@/domain/accounts/entities/__tests__/account.builder'; @@ -70,6 +72,8 @@ describe('AccountsController', () => { .useModule(TestAccountsDataSourceModule) .overrideModule(CounterfactualSafesDatasourceModule) .useModule(TestCounterfactualSafesDataSourceModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/accounts/counterfactual-safes/counterfactual-safes.controller.spec.ts b/src/routes/accounts/counterfactual-safes/counterfactual-safes.controller.spec.ts index f51a231ddf..4f79a1a16c 100644 --- a/src/routes/accounts/counterfactual-safes/counterfactual-safes.controller.spec.ts +++ b/src/routes/accounts/counterfactual-safes/counterfactual-safes.controller.spec.ts @@ -17,6 +17,8 @@ import { TestNetworkModule } from '@/datasources/network/__tests__/test.network. import { NetworkModule } from '@/datasources/network/network.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import type { IAccountsRepository } from '@/domain/accounts/accounts.repository.interface'; import { counterfactualSafeBuilder } from '@/domain/accounts/counterfactual-safes/entities/__tests__/counterfactual-safe.builder'; import { createCounterfactualSafeDtoBuilder } from '@/domain/accounts/counterfactual-safes/entities/__tests__/create-counterfactual-safe.dto.entity.builder'; @@ -66,6 +68,8 @@ describe('CounterfactualSafesController', () => { .useModule(TestAccountsDataSourceModule) .overrideModule(CounterfactualSafesDatasourceModule) .useModule(TestCounterfactualSafesDataSourceModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/alerts/alerts.controller.spec.ts b/src/routes/alerts/alerts.controller.spec.ts index aa762ce17d..8b6b1200e1 100644 --- a/src/routes/alerts/alerts.controller.spec.ts +++ b/src/routes/alerts/alerts.controller.spec.ts @@ -56,6 +56,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; // The `x-tenderly-signature` header contains a cryptographic signature. The webhook request signature is // a HMAC SHA256 hash of concatenated signing secret, request payload, and timestamp, in this order. @@ -103,6 +105,8 @@ describe('Alerts (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(ALERTS_CONFIGURATION_MODULE) .useModule(AlertsConfigurationModule.register(alertsConfiguration)) .overrideModule(ALERTS_API_CONFIGURATION_MODULE) @@ -897,6 +901,8 @@ describe('Alerts (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/auth/auth.controller.spec.ts b/src/routes/auth/auth.controller.spec.ts index 88df6f847c..2c3c05818e 100644 --- a/src/routes/auth/auth.controller.spec.ts +++ b/src/routes/auth/auth.controller.spec.ts @@ -35,6 +35,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; const verifySiweMessageMock = jest.fn(); @@ -52,6 +54,8 @@ describe('AuthController', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(BlockchainApiManagerModule) .useModule(TestBlockchainApiManagerModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/balances/__tests__/controllers/zerion-balances.controller.spec.ts b/src/routes/balances/__tests__/controllers/zerion-balances.controller.spec.ts index 2d398987ab..7b9290991f 100644 --- a/src/routes/balances/__tests__/controllers/zerion-balances.controller.spec.ts +++ b/src/routes/balances/__tests__/controllers/zerion-balances.controller.spec.ts @@ -37,6 +37,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Balances Controller (Unit)', () => { let app: INestApplication; @@ -75,6 +77,8 @@ describe('Balances Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/balances/balances.controller.spec.ts b/src/routes/balances/balances.controller.spec.ts index 3331bd3adc..6fcc529deb 100644 --- a/src/routes/balances/balances.controller.spec.ts +++ b/src/routes/balances/balances.controller.spec.ts @@ -15,6 +15,8 @@ import type { INetworkService } from '@/datasources/network/network.service.inte import { NetworkService } from '@/datasources/network/network.service.interface'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import { balanceBuilder } from '@/domain/balances/entities/__tests__/balance.builder'; import { balanceTokenBuilder } from '@/domain/balances/entities/__tests__/balance.token.builder'; import { chainBuilder } from '@/domain/chains/entities/__tests__/chain.builder'; @@ -54,6 +56,8 @@ describe('Balances Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/chains/chains.controller.spec.ts b/src/routes/chains/chains.controller.spec.ts index e2aa3a4da3..a8cacd0e87 100644 --- a/src/routes/chains/chains.controller.spec.ts +++ b/src/routes/chains/chains.controller.spec.ts @@ -36,6 +36,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Chains Controller (Unit)', () => { let app: INestApplication; @@ -64,6 +66,8 @@ describe('Chains Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/collectibles/__tests__/controllers/zerion-collectibles.controller.spec.ts b/src/routes/collectibles/__tests__/controllers/zerion-collectibles.controller.spec.ts index 5ee62a0aa0..d9928a64c3 100644 --- a/src/routes/collectibles/__tests__/controllers/zerion-collectibles.controller.spec.ts +++ b/src/routes/collectibles/__tests__/controllers/zerion-collectibles.controller.spec.ts @@ -31,6 +31,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Zerion Collectibles Controller', () => { let app: INestApplication; @@ -47,6 +49,8 @@ describe('Zerion Collectibles Controller', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/collectibles/collectibles.controller.spec.ts b/src/routes/collectibles/collectibles.controller.spec.ts index 38336c9647..ea8dcc47da 100644 --- a/src/routes/collectibles/collectibles.controller.spec.ts +++ b/src/routes/collectibles/collectibles.controller.spec.ts @@ -36,6 +36,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Collectibles Controller (Unit)', () => { let app: INestApplication; @@ -59,6 +61,8 @@ describe('Collectibles Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/community/community.controller.spec.ts b/src/routes/community/community.controller.spec.ts index 9584400998..1a7f984d0a 100644 --- a/src/routes/community/community.controller.spec.ts +++ b/src/routes/community/community.controller.spec.ts @@ -50,6 +50,8 @@ import { IdentityApiModule } from '@/datasources/locking-api/identity-api.module import { TestIdentityApiModule } from '@/datasources/locking-api/__tests__/test.identity-api.module'; import { IIdentityApi } from '@/domain/interfaces/identity-api.interface'; import { eligibilityBuilder } from '@/domain/community/entities/__tests__/eligibility.builder'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Community (Unit)', () => { let app: INestApplication; @@ -65,6 +67,8 @@ describe('Community (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/contracts/__tests__/get-contract.e2e-spec.ts b/src/routes/contracts/__tests__/get-contract.e2e-spec.ts index 6d0217bbb1..4ee3c2a97b 100644 --- a/src/routes/contracts/__tests__/get-contract.e2e-spec.ts +++ b/src/routes/contracts/__tests__/get-contract.e2e-spec.ts @@ -13,6 +13,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Get contract e2e test', () => { let app: INestApplication; @@ -30,6 +32,8 @@ describe('Get contract e2e test', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/routes/contracts/contracts.controller.spec.ts b/src/routes/contracts/contracts.controller.spec.ts index 0e4437a472..2a6f136929 100644 --- a/src/routes/contracts/contracts.controller.spec.ts +++ b/src/routes/contracts/contracts.controller.spec.ts @@ -24,6 +24,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Contracts controller', () => { let app: INestApplication; @@ -38,6 +40,8 @@ describe('Contracts controller', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/data-decode/__tests__/data-decode.e2e-spec.ts b/src/routes/data-decode/__tests__/data-decode.e2e-spec.ts index 919c4c8ec1..638da3bdd0 100644 --- a/src/routes/data-decode/__tests__/data-decode.e2e-spec.ts +++ b/src/routes/data-decode/__tests__/data-decode.e2e-spec.ts @@ -14,6 +14,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Data decode e2e tests', () => { let app: INestApplication; @@ -30,6 +32,8 @@ describe('Data decode e2e tests', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/routes/delegates/delegates.controller.spec.ts b/src/routes/delegates/delegates.controller.spec.ts index 91f35ac53b..42543fe272 100644 --- a/src/routes/delegates/delegates.controller.spec.ts +++ b/src/routes/delegates/delegates.controller.spec.ts @@ -31,6 +31,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Delegates controller', () => { let app: INestApplication; @@ -45,6 +47,8 @@ describe('Delegates controller', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/delegates/v2/delegates.v2.controller.spec.ts b/src/routes/delegates/v2/delegates.v2.controller.spec.ts index 6dcaced011..ecb95354dd 100644 --- a/src/routes/delegates/v2/delegates.v2.controller.spec.ts +++ b/src/routes/delegates/v2/delegates.v2.controller.spec.ts @@ -15,6 +15,8 @@ import type { INetworkService } from '@/datasources/network/network.service.inte import { NetworkService } from '@/datasources/network/network.service.interface'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import { chainBuilder } from '@/domain/chains/entities/__tests__/chain.builder'; import { delegateBuilder } from '@/domain/delegate/entities/__tests__/delegate.builder'; import { pageBuilder } from '@/domain/entities/__tests__/page.builder'; @@ -53,6 +55,8 @@ describe('Delegates controller', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/estimations/estimations.controller.spec.ts b/src/routes/estimations/estimations.controller.spec.ts index f3a9105f78..e54df550d0 100644 --- a/src/routes/estimations/estimations.controller.spec.ts +++ b/src/routes/estimations/estimations.controller.spec.ts @@ -32,6 +32,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Estimations Controller (Unit)', () => { let app: INestApplication; @@ -46,6 +48,8 @@ describe('Estimations Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/health/__tests__/get-health.e2e-spec.ts b/src/routes/health/__tests__/get-health.e2e-spec.ts index 851b175ca8..15bea73f44 100644 --- a/src/routes/health/__tests__/get-health.e2e-spec.ts +++ b/src/routes/health/__tests__/get-health.e2e-spec.ts @@ -11,6 +11,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Get health e2e test', () => { let app: INestApplication; @@ -26,6 +28,8 @@ describe('Get health e2e test', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/routes/health/health.controller.spec.ts b/src/routes/health/health.controller.spec.ts index eebcf61324..d73d08d91a 100644 --- a/src/routes/health/health.controller.spec.ts +++ b/src/routes/health/health.controller.spec.ts @@ -22,6 +22,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Health Controller tests', () => { let app: INestApplication; @@ -36,6 +38,8 @@ describe('Health Controller tests', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/hooks/__tests__/event-hooks-queue.e2e-spec.ts b/src/routes/hooks/__tests__/event-hooks-queue.e2e-spec.ts index 35567c6013..73a55526cc 100644 --- a/src/routes/hooks/__tests__/event-hooks-queue.e2e-spec.ts +++ b/src/routes/hooks/__tests__/event-hooks-queue.e2e-spec.ts @@ -19,6 +19,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Events queue processing e2e tests', () => { let app: INestApplication; @@ -47,6 +49,8 @@ describe('Events queue processing e2e tests', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .compile(); app = await new TestAppProvider().provide(moduleRef); diff --git a/src/routes/hooks/hooks-cache.controller.spec.ts b/src/routes/hooks/hooks-cache.controller.spec.ts index bf2f3b8b8a..df00507d48 100644 --- a/src/routes/hooks/hooks-cache.controller.spec.ts +++ b/src/routes/hooks/hooks-cache.controller.spec.ts @@ -34,6 +34,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; // TODO: Migrate to E2E tests as TransactionEventType events are already being received via queue. describe.skip('Post Hook Events for Cache (Unit)', () => { @@ -54,6 +56,8 @@ describe.skip('Post Hook Events for Cache (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/hooks/hooks-notifications.spec.ts b/src/routes/hooks/hooks-notifications.spec.ts index 678aa641dc..dde001e079 100644 --- a/src/routes/hooks/hooks-notifications.spec.ts +++ b/src/routes/hooks/hooks-notifications.spec.ts @@ -54,6 +54,8 @@ import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres- import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; // TODO: Migrate to E2E tests as TransactionEventType events are already being received via queue. describe.skip('Post Hook Events for Notifications (Unit)', () => { @@ -82,6 +84,8 @@ describe.skip('Post Hook Events for Notifications (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/hooks/hooks.controller.spec.ts b/src/routes/hooks/hooks.controller.spec.ts index bab1355332..74a734687f 100644 --- a/src/routes/hooks/hooks.controller.spec.ts +++ b/src/routes/hooks/hooks.controller.spec.ts @@ -21,6 +21,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Post Hook Events (Unit)', () => { let app: INestApplication; @@ -33,6 +35,8 @@ describe('Post Hook Events (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/messages/messages.controller.spec.ts b/src/routes/messages/messages.controller.spec.ts index a918b67b65..d7986259d5 100644 --- a/src/routes/messages/messages.controller.spec.ts +++ b/src/routes/messages/messages.controller.spec.ts @@ -36,6 +36,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Messages controller', () => { let app: INestApplication; @@ -50,6 +52,8 @@ describe('Messages controller', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/notifications/v1/notifications.controller.spec.ts b/src/routes/notifications/v1/notifications.controller.spec.ts index 02e5fae023..bf623f3d13 100644 --- a/src/routes/notifications/v1/notifications.controller.spec.ts +++ b/src/routes/notifications/v1/notifications.controller.spec.ts @@ -28,6 +28,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Notifications Controller (Unit)', () => { let app: INestApplication; @@ -42,6 +44,8 @@ describe('Notifications Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/notifications/v2/notifications.controller.spec.ts b/src/routes/notifications/v2/notifications.controller.spec.ts index 1c08cb375f..89cfc8b757 100644 --- a/src/routes/notifications/v2/notifications.controller.spec.ts +++ b/src/routes/notifications/v2/notifications.controller.spec.ts @@ -43,6 +43,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Notifications Controller V2 (Unit)', () => { let app: INestApplication; @@ -74,6 +76,8 @@ describe('Notifications Controller V2 (Unit)', () => { .useModule(TestAccountsDataSourceModule) .overrideModule(CounterfactualSafesDatasourceModule) .useModule(TestCounterfactualSafesDataSourceModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(NotificationsDatasourceModule) .useModule(TestNotificationsDatasourceModule) .overrideModule(CacheModule) diff --git a/src/routes/owners/__tests__/get-safes-by-owner.e2e-spec.ts b/src/routes/owners/__tests__/get-safes-by-owner.e2e-spec.ts index 5e3127d376..ab5c2af70b 100644 --- a/src/routes/owners/__tests__/get-safes-by-owner.e2e-spec.ts +++ b/src/routes/owners/__tests__/get-safes-by-owner.e2e-spec.ts @@ -13,6 +13,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Get safes by owner e2e test', () => { let app: INestApplication; @@ -29,6 +31,8 @@ describe('Get safes by owner e2e test', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/routes/owners/owners.controller.spec.ts b/src/routes/owners/owners.controller.spec.ts index 38b65e4405..22fe55fc3c 100644 --- a/src/routes/owners/owners.controller.spec.ts +++ b/src/routes/owners/owners.controller.spec.ts @@ -30,6 +30,8 @@ import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.mo import { ChainsRepository } from '@/domain/chains/chains.repository'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Owners Controller (Unit)', () => { let app: INestApplication; @@ -44,6 +46,8 @@ describe('Owners Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/recovery/recovery.controller.spec.ts b/src/routes/recovery/recovery.controller.spec.ts index 79067f1c6e..d1c95d4fc8 100644 --- a/src/routes/recovery/recovery.controller.spec.ts +++ b/src/routes/recovery/recovery.controller.spec.ts @@ -43,6 +43,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Recovery (Unit)', () => { let app: INestApplication; @@ -71,6 +73,8 @@ describe('Recovery (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(ALERTS_CONFIGURATION_MODULE) .useModule(AlertsConfigurationModule.register(alertsConfiguration)) .overrideModule(ALERTS_API_CONFIGURATION_MODULE) diff --git a/src/routes/relay/relay.controller.spec.ts b/src/routes/relay/relay.controller.spec.ts index a162390b39..7aac087eee 100644 --- a/src/routes/relay/relay.controller.spec.ts +++ b/src/routes/relay/relay.controller.spec.ts @@ -59,6 +59,8 @@ import { execTransactionFromModuleEncoder, executeNextTxEncoder, } from '@/domain/alerts/contracts/__tests__/encoders/delay-modifier-encoder.builder'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; const supportedChainIds = faker.helpers.arrayElements( Object.keys(configuration().relay.apiKey), @@ -110,6 +112,8 @@ describe('Relay controller', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/root/root.controller.spec.ts b/src/routes/root/root.controller.spec.ts index 4270843fac..a5a0e062a5 100644 --- a/src/routes/root/root.controller.spec.ts +++ b/src/routes/root/root.controller.spec.ts @@ -14,6 +14,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Root Controller tests', () => { let app: INestApplication; @@ -24,6 +26,8 @@ describe('Root Controller tests', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(QueuesApiModule) diff --git a/src/routes/safe-apps/__tests__/get-safe-apps.e2e-spec.ts b/src/routes/safe-apps/__tests__/get-safe-apps.e2e-spec.ts index 169df031e2..10d0b88f5a 100644 --- a/src/routes/safe-apps/__tests__/get-safe-apps.e2e-spec.ts +++ b/src/routes/safe-apps/__tests__/get-safe-apps.e2e-spec.ts @@ -14,6 +14,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Get Safe Apps e2e test', () => { let app: INestApplication; @@ -31,6 +33,8 @@ describe('Get Safe Apps e2e test', () => { .useModule(TestPostgresDatabaseModule) .overrideModule(PostgresDatabaseModuleV2) .useModule(TestPostgresDatabaseModuleV2) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(QueuesApiModule) .useModule(TestQueuesApiModule) .compile(); diff --git a/src/routes/safe-apps/safe-apps.controller.spec.ts b/src/routes/safe-apps/safe-apps.controller.spec.ts index 81af293dc6..dc1aacdaae 100644 --- a/src/routes/safe-apps/safe-apps.controller.spec.ts +++ b/src/routes/safe-apps/safe-apps.controller.spec.ts @@ -26,6 +26,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Safe Apps Controller (Unit)', () => { let app: INestApplication; @@ -40,6 +42,8 @@ describe('Safe Apps Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/safes/safes.controller.nonces.spec.ts b/src/routes/safes/safes.controller.nonces.spec.ts index 83043d4a4c..e6f233718c 100644 --- a/src/routes/safes/safes.controller.nonces.spec.ts +++ b/src/routes/safes/safes.controller.nonces.spec.ts @@ -28,6 +28,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Safes Controller Nonces (Unit)', () => { let app: INestApplication; @@ -43,6 +45,8 @@ describe('Safes Controller Nonces (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/safes/safes.controller.overview.spec.ts b/src/routes/safes/safes.controller.overview.spec.ts index 1bc8c518ab..1da609dd19 100644 --- a/src/routes/safes/safes.controller.overview.spec.ts +++ b/src/routes/safes/safes.controller.overview.spec.ts @@ -34,6 +34,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Safes Controller Overview (Unit)', () => { let app: INestApplication; @@ -64,6 +66,8 @@ describe('Safes Controller Overview (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/safes/safes.controller.spec.ts b/src/routes/safes/safes.controller.spec.ts index 27e011d2cc..3e99f7344a 100644 --- a/src/routes/safes/safes.controller.spec.ts +++ b/src/routes/safes/safes.controller.spec.ts @@ -45,6 +45,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Safes Controller (Unit)', () => { let app: INestApplication; @@ -59,6 +61,8 @@ describe('Safes Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/targeted-messaging/targeted-messaging.controller.spec.ts b/src/routes/targeted-messaging/targeted-messaging.controller.spec.ts index 72c9509d94..de0fce8a7f 100644 --- a/src/routes/targeted-messaging/targeted-messaging.controller.spec.ts +++ b/src/routes/targeted-messaging/targeted-messaging.controller.spec.ts @@ -41,17 +41,8 @@ describe('TargetedMessagingController', () => { let targetedMessagingDatasource: jest.MockedObjectDeep; beforeEach(async () => { - const defaultConfiguration = configuration(); - const testConfiguration = (): typeof defaultConfiguration => ({ - ...defaultConfiguration, - features: { - ...defaultConfiguration.features, - targetedMessaging: true, - }, - }); - const moduleFixture: TestingModule = await Test.createTestingModule({ - imports: [AppModule.register(testConfiguration)], + imports: [AppModule.register(configuration)], }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) diff --git a/src/routes/transactions/__tests__/controllers/delete-transaction.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/delete-transaction.transactions.controller.spec.ts index 8e61f6f00f..5dae4bc794 100644 --- a/src/routes/transactions/__tests__/controllers/delete-transaction.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/delete-transaction.transactions.controller.spec.ts @@ -32,6 +32,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Delete Transaction - Transactions Controller (Unit', () => { let app: INestApplication; @@ -47,6 +49,8 @@ describe('Delete Transaction - Transactions Controller (Unit', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/get-creation-transaction.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/get-creation-transaction.transactions.controller.spec.ts index 3b1e7e2ec4..af65c54ce7 100644 --- a/src/routes/transactions/__tests__/controllers/get-creation-transaction.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/get-creation-transaction.transactions.controller.spec.ts @@ -15,6 +15,8 @@ import type { INetworkService } from '@/datasources/network/network.service.inte import { NetworkService } from '@/datasources/network/network.service.interface'; import { TestQueuesApiModule } from '@/datasources/queues/__tests__/test.queues-api.module'; import { QueuesApiModule } from '@/datasources/queues/queues-api.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import { chainBuilder } from '@/domain/chains/entities/__tests__/chain.builder'; import { creationTransactionBuilder, @@ -41,6 +43,8 @@ describe('Get creation transaction', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/get-transaction-by-id.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/get-transaction-by-id.transactions.controller.spec.ts index ca9e2dbeb8..182e5247bb 100644 --- a/src/routes/transactions/__tests__/controllers/get-transaction-by-id.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/get-transaction-by-id.transactions.controller.spec.ts @@ -44,6 +44,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Get by id - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -58,6 +60,8 @@ describe('Get by id - Transactions Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/list-incoming-transfers-by-safe.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/list-incoming-transfers-by-safe.transactions.controller.spec.ts index b2e375c977..86170d4bde 100644 --- a/src/routes/transactions/__tests__/controllers/list-incoming-transfers-by-safe.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/list-incoming-transfers-by-safe.transactions.controller.spec.ts @@ -41,6 +41,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('List incoming transfers by Safe - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -55,6 +57,8 @@ describe('List incoming transfers by Safe - Transactions Controller (Unit)', () }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/list-module-transactions-by-safe.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/list-module-transactions-by-safe.transactions.controller.spec.ts index 0bc66fece5..f0a6662121 100644 --- a/src/routes/transactions/__tests__/controllers/list-module-transactions-by-safe.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/list-module-transactions-by-safe.transactions.controller.spec.ts @@ -30,6 +30,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('List module transactions by Safe - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -44,6 +46,8 @@ describe('List module transactions by Safe - Transactions Controller (Unit)', () }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/list-multisig-transactions-by-safe.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/list-multisig-transactions-by-safe.transactions.controller.spec.ts index 9274571baa..9a69227ee7 100644 --- a/src/routes/transactions/__tests__/controllers/list-multisig-transactions-by-safe.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/list-multisig-transactions-by-safe.transactions.controller.spec.ts @@ -40,6 +40,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('List multisig transactions by Safe - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -54,6 +56,8 @@ describe('List multisig transactions by Safe - Transactions Controller (Unit)', }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/preview-transaction-cow-swap.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/preview-transaction-cow-swap.transactions.controller.spec.ts index e7a8062cd4..fd8976e51d 100644 --- a/src/routes/transactions/__tests__/controllers/preview-transaction-cow-swap.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/preview-transaction-cow-swap.transactions.controller.spec.ts @@ -36,6 +36,8 @@ import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.mo import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Preview transaction - CoW Swap - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -63,6 +65,8 @@ describe('Preview transaction - CoW Swap - Transactions Controller (Unit)', () = }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/preview-transaction-kiln.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/preview-transaction-kiln.transactions.controller.spec.ts index 2df488cf54..82db4a48de 100644 --- a/src/routes/transactions/__tests__/controllers/preview-transaction-kiln.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/preview-transaction-kiln.transactions.controller.spec.ts @@ -48,6 +48,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Preview transaction - Kiln - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -72,6 +74,8 @@ describe('Preview transaction - Kiln - Transactions Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/preview-transaction.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/preview-transaction.transactions.controller.spec.ts index f5ae444c31..920c29ddd4 100644 --- a/src/routes/transactions/__tests__/controllers/preview-transaction.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/preview-transaction.transactions.controller.spec.ts @@ -32,6 +32,8 @@ import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.post import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database.module'; import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Preview transaction - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -46,6 +48,8 @@ describe('Preview transaction - Transactions Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/__tests__/controllers/propose-transaction.transactions.controller.spec.ts b/src/routes/transactions/__tests__/controllers/propose-transaction.transactions.controller.spec.ts index 17f6c65bd3..e3959111ab 100644 --- a/src/routes/transactions/__tests__/controllers/propose-transaction.transactions.controller.spec.ts +++ b/src/routes/transactions/__tests__/controllers/propose-transaction.transactions.controller.spec.ts @@ -34,6 +34,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Propose transaction - Transactions Controller (Unit)', () => { let app: INestApplication; @@ -48,6 +50,8 @@ describe('Propose transaction - Transactions Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/transactions-history.controller.spec.ts b/src/routes/transactions/transactions-history.controller.spec.ts index bbb61d36a2..4466b30ae1 100644 --- a/src/routes/transactions/transactions-history.controller.spec.ts +++ b/src/routes/transactions/transactions-history.controller.spec.ts @@ -64,6 +64,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Transactions History Controller (Unit)', () => { let app: INestApplication; @@ -89,6 +91,8 @@ describe('Transactions History Controller (Unit)', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/transactions-history.imitation-transactions.controller.spec.ts b/src/routes/transactions/transactions-history.imitation-transactions.controller.spec.ts index 545657d89b..a7a452358c 100644 --- a/src/routes/transactions/transactions-history.imitation-transactions.controller.spec.ts +++ b/src/routes/transactions/transactions-history.imitation-transactions.controller.spec.ts @@ -52,6 +52,8 @@ import { PostgresDatabaseModuleV2 } from '@/datasources/db/v2/postgres-database. import { TestPostgresDatabaseModuleV2 } from '@/datasources/db/v2/test.postgres-database.module'; import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; import { TestPostgresDatabaseModule } from '@/datasources/db/__tests__/test.postgres-database.module'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; describe('Transactions History Controller (Unit) - Imitation Transactions', () => { let app: INestApplication; @@ -92,6 +94,8 @@ describe('Transactions History Controller (Unit) - Imitation Transactions', () = }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule) diff --git a/src/routes/transactions/transactions-view.controller.spec.ts b/src/routes/transactions/transactions-view.controller.spec.ts index 1add014757..c5bb645348 100644 --- a/src/routes/transactions/transactions-view.controller.spec.ts +++ b/src/routes/transactions/transactions-view.controller.spec.ts @@ -20,6 +20,8 @@ import { networkStatsBuilder } from '@/datasources/staking-api/entities/__tests_ import { stakeBuilder } from '@/datasources/staking-api/entities/__tests__/stake.entity.builder'; import type { Stake } from '@/datasources/staking-api/entities/stake.entity'; import { StakeState } from '@/datasources/staking-api/entities/stake.entity'; +import { TestTargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/__tests__/test.targeted-messaging.datasource.module'; +import { TargetedMessagingDatasourceModule } from '@/datasources/targeted-messaging/targeted-messaging.datasource.module'; import { chainBuilder } from '@/domain/chains/entities/__tests__/chain.builder'; import { getNumberString } from '@/domain/common/utils/utils'; import { @@ -76,6 +78,8 @@ describe('TransactionsViewController tests', () => { }) .overrideModule(PostgresDatabaseModule) .useModule(TestPostgresDatabaseModule) + .overrideModule(TargetedMessagingDatasourceModule) + .useModule(TestTargetedMessagingDatasourceModule) .overrideModule(CacheModule) .useModule(TestCacheModule) .overrideModule(RequestScopedLoggingModule)