Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceManiac committed Apr 29, 2024
1 parent fdea349 commit 334a103
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Controller, Get, Path, Query, Route } from 'tsoa';
import { EngineService } from '../EngineService';
import { EngineService } from '../EngineService.js';
import { ENV } from '@paima/utils';
import {
import type {
AchievementService,
AchievementPublicList,
PlayerAchievements,
Expand Down Expand Up @@ -65,6 +65,6 @@ export class AchievementsController extends Controller {
@Query() name?: string
): Promise<PlayerAchievements> {
const wallet = await service().getNftOwner(nft_address);
return this.wallet(wallet, name);
return await this.wallet(wallet, name);
}
}
8 changes: 5 additions & 3 deletions packages/engine/paima-standalone/src/utils/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ interface GameCodeCjs {
default: GameStateTransitionFunctionRouter;
}
/**
* Reads repackaged user's code placed next to the executable in `gameCode.cjs` file
* Reads packaged user's code placed next to the executable in `gameCode.cjs` file.
*/
export function importGameStateTransitionRouter(): GameStateTransitionFunctionRouter {
// dynamic import cannot be used here due to PKG limitations
// eslint-disable-next-line @typescript-eslint/no-var-requires
return (require(`${process.cwd()}/${ROUTER_FILENAME}`) as GameCodeCjs).default;
}

Expand All @@ -19,7 +21,7 @@ export interface EndpointsCjs {
AchievementService?: new () => AchievementService;
}
/**
* Reads repackaged user's code placed next to the executable in `endpoints.cjs` file
* Reads packaged user's code placed next to the executable in `endpoints.cjs` file.
*/
export function importEndpoints(): EndpointsCjs {
return require(`${process.cwd()}/${API_FILENAME}`);
Expand All @@ -28,7 +30,7 @@ export function importEndpoints(): EndpointsCjs {
export const GAME_OPENAPI_FILENAME = 'packaged/openapi.json';
export type OpenApiJson = object;
/**
* Reads repackaged user's code placed next to the executable in `endpoints.cjs` file
* Reads packaged user's OpenAPI definitions placed next to the executable in `openapi.json` file.
*/
export function importOpenApiJson(): OpenApiJson | undefined {
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/paima-standalone/src/utils/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const runPaimaEngine = async (): Promise<void> => {
process.exit(0);
}

const [_, config] = await GlobalConfig.mainEvmConfig();
const [, config] = await GlobalConfig.mainEvmConfig();

// Check that packed game code is available
if (checkForPackedGameCode()) {
Expand Down
2 changes: 1 addition & 1 deletion packages/node-sdk/paima-utils-backend/src/achievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface Player {
/** e.g. addr1234... or 0x1234... */
wallet: string;
/** Optional wallet-type */
walletType?: 'cardano' | 'evm' | 'polkadot' | 'algorand' | string;
walletType?: string; // ex: 'cardano' | 'evm' | 'polkadot' | 'algorand'
/** If data for specific user: e.g., "1", "player-1", "unique-name", etc. */
userId?: string;
/** Player display name */
Expand Down
2 changes: 1 addition & 1 deletion packages/node-sdk/paima-utils-backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Crypto from 'crypto';
export { parseSecurityYaml } from './security.js';
export * from './cde-access.js';
export type * from './types.js';
export * from './achievements';
export * from './achievements.js';

export function hashTogether(data: string[]): string {
return Crypto.createHash('sha256').update(data.join()).digest('base64');
Expand Down

0 comments on commit 334a103

Please sign in to comment.