Skip to content

Commit

Permalink
Fixed more errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
burtonator committed Aug 8, 2024
1 parent f4486a1 commit 30ba701
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/model/src/chain-events/ChainEventCreated.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function ChainEventCreated(): Command<typeof schemas.ChainEventCreated> {
return {
...schemas.ChainEventCreated,
auth: [],
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/require-await
body: async ({ payload }) => {
// The name of the chain e.g. BaseSepolia (ex webhook url: /v1/rest/chainevent/ChainEventCreated/BaseSepolia)
// let chain = id!;
Expand Down
2 changes: 2 additions & 0 deletions libs/model/src/contest/Contests.projection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ export function Contests(): Projection<typeof inputs> {
thread_id: add_action!.thread_id,
created_at: new Date(),
});

// eslint-disable-next-line @typescript-eslint/no-misused-promises
setImmediate(() => updateScore(payload.contest_address, contest_id));
},
},
Expand Down
1 change: 1 addition & 0 deletions libs/model/src/globalActivityCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class GlobalActivityCache {

public async start() {
await this.refreshGlobalActivity();
// eslint-disable-next-line @typescript-eslint/no-misused-promises
setInterval(this.refreshGlobalActivity.bind(this), this._cacheTTL * 1000);
}

Expand Down
2 changes: 2 additions & 0 deletions libs/model/src/middleware/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const loadThread: ThreadMiddleware = async ({ payload }) => {
return thread;
};

// eslint-disable-next-line @typescript-eslint/require-await
export const isThreadAuthor: ThreadMiddleware = async ({ actor }, state) => {
// super admin is always allowed
if (actor.user.isAdmin) return;
Expand Down Expand Up @@ -125,6 +126,7 @@ export const loadComment: CommentMiddleware = async ({ payload }) => {
return comment;
};

// eslint-disable-next-line @typescript-eslint/require-await
export const isCommentAuthor: CommentMiddleware = async ({ actor }, state) => {
// super admin is always allowed
if (actor.user.isAdmin) return;
Expand Down
2 changes: 2 additions & 0 deletions libs/model/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export const syncDb = async (db: DB, log = false) => {
const fks = Object.keys(Factories).flatMap(
(k) => db[k as keyof typeof Factories]._fks,
);
// eslint-disable-next-line @typescript-eslint/no-misused-promises
fks.forEach((fk) => dropFk(db.sequelize, fk));
await db.sequelize.sync({
force: true,
logging: log ? console.log : false,
});
// eslint-disable-next-line @typescript-eslint/no-misused-promises
fks.forEach((fk) => createFk(db.sequelize, fk));
};

Expand Down
1 change: 1 addition & 0 deletions libs/model/src/services/commonProtocol/contestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type ContestScores = {
* @param rpc the rpc of the network to use helper with
* @returns
*/
// eslint-disable-next-line @typescript-eslint/require-await
const createWeb3Provider = async (rpc: string): Promise<Web3> => {
if (!config.WEB3.PRIVATE_KEY) throw new AppError('WEB3 private key not set!');
const web3 = new Web3(rpc);
Expand Down
1 change: 1 addition & 0 deletions libs/model/src/tester/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const verify_db = async (name: string): Promise<void> => {
console.error(`Error verifying db [${name}]:`, error);
throw error;
} finally {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
pg && pg.close();
}
};
Expand Down
2 changes: 1 addition & 1 deletion libs/model/src/thread/GetBulkThread.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export function GetBulkThreads(): Query<typeof schemas.GetBulkThreads> {
}

// transform thread response
let threads = responseThreads.map(async (t: any) => {
let threads = responseThreads.map((t: any) => {
const collaborators = JSON.parse(t.collaborators[0]).address?.length
? t.collaborators.map((c: any) => JSON.parse(c))
: [];
Expand Down
3 changes: 3 additions & 0 deletions libs/sitemaps/src/createDatabasePaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export function createDatabasePaginatorWithAdapter(

let records: ReadonlyArray<Link> = [];

// eslint-disable-next-line @typescript-eslint/require-await
async function hasNext() {
return idx === 0 || records.length !== 0;
}
Expand Down Expand Up @@ -187,10 +188,12 @@ export function createDatabasePaginatorMockForTable(

let idx = 0;

// eslint-disable-next-line @typescript-eslint/require-await
async function hasNext() {
return pageIdx <= maxPages;
}

// eslint-disable-next-line @typescript-eslint/require-await
async function next(): Promise<Page> {
++pageIdx;
const links = [
Expand Down

0 comments on commit 30ba701

Please sign in to comment.