Skip to content

Commit

Permalink
fix(deployment): pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
baktun14 committed Nov 22, 2024
1 parent 221012c commit 7388d08
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EncodeObject } from "@cosmjs/proto-signing";
import { singleton } from "tsyringe";

import { UserWalletOutput } from "@src/billing/repositories";
import { AUDITOR, TRIAL_ATTRIBUTE } from "@src/utils/constants";
import { AUDITOR, TRIAL_ATTRIBUTE } from "@src/deployment/config/provider.config";

@singleton()
export class TrialValidationService {
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/deployment/config/config.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ container.register(DEPLOYMENT_CONFIG, { useValue: config });

export type DeploymentConfig = typeof config;

export const InjectDeploymentConfig = () => inject(DEPLOYMENT_CONFIG);
export const InjectDeploymentConfig = () => inject(DEPLOYMENT_CONFIG);
2 changes: 2 additions & 0 deletions apps/api/src/deployment/config/provider.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const TRIAL_ATTRIBUTE = "console/trials";
export const AUDITOR = "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63";
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TrialProvidersService } from "@src/deployment/services/trial-providers/
export class ProviderController {
constructor(private readonly trialProvidersService: TrialProvidersService) {}

async findTrialProviders(): Promise<string[]> {
return await this.trialProvidersService.findTrialProviders();
async getTrialProviders(): Promise<string[]> {
return await this.trialProvidersService.getTrialProviders();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ProviderAttributeSignature } from "@akashnetwork/database/dbSchemas/akash";
import { singleton } from "tsyringe";

import { AUDITOR, TRIAL_ATTRIBUTE } from "@src/utils/constants";
import { AUDITOR, TRIAL_ATTRIBUTE } from "@src/deployment/config/provider.config";

@singleton()
export class ProviderRepository {
async findTrialProviders(): Promise<string[]> {
async getTrialProviders(): Promise<string[]> {
const trialProviders = await ProviderAttributeSignature.findAll({
attributes: ["provider"],
where: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ProviderRepository } from "@src/deployment/repositories/provider/provid
export class TrialProvidersService {
constructor(private readonly providerRepository: ProviderRepository) {}

async findTrialProviders(): Promise<string[]> {
return await this.providerRepository.findTrialProviders();
async getTrialProviders(): Promise<string[]> {
return await this.providerRepository.getTrialProviders();
}
}
2 changes: 1 addition & 1 deletion apps/api/src/routes/v1/trialProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ const route = createRoute({
});

export default new OpenAPIHono().openapi(route, async c => {
const response = await container.resolve(ProviderController).findTrialProviders();
const response = await container.resolve(ProviderController).getTrialProviders();
return c.json(response, 200);
});
3 changes: 0 additions & 3 deletions apps/api/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ export const defaultNodeUrlMapping: { [key: string]: string } = {
export const apiNodeUrl = env.REST_API_NODE_URL ?? defaultNodeUrlMapping[env.NETWORK] ?? defaultNodeUrlMapping.mainnet;
export const betaTypeVersion = "v1beta3";
export const betaTypeVersionMarket = "v1beta4";

export const TRIAL_ATTRIBUTE = "console/trials";
export const AUDITOR = "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63";

0 comments on commit 7388d08

Please sign in to comment.