Skip to content

Commit 03cc831

Browse files
committed
chore: address feedback from PR
1 parent 2f6e70a commit 03cc831

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ module.exports = {
88
project: `./tsconfig.json`,
99
},
1010
parser: "@typescript-eslint/parser",
11-
plugins: ["@typescript-eslint"],
11+
plugins: ["@typescript-eslint", "no-only-tests"],
1212
root: true,
1313
rules: {
1414
"no-unused-vars": "off",
15+
"no-only-tests/no-only-tests": "error",
1516
"@typescript-eslint/no-misused-promises": [
1617
"error",
1718
{

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"@typescript-eslint/parser": "^5.55.0",
7575
"concurrently": "^8.2.0",
7676
"eslint": "^8.36.0",
77+
"eslint-plugin-no-only-tests": "^3.1.0",
7778
"lefthook": "^1.4.8",
7879
"prettier": "^3.0.1",
7980
"supertest": "^6.3.3",

src/calculator/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export default class Calculator {
296296
`${this.chainId}/rounds.json`
297297
);
298298

299-
const round = rounds.find((r: Round) => r.id === this.roundId);
299+
const round = rounds.find((round) => round.id === this.roundId);
300300

301301
if (round === undefined) {
302302
throw new ResourceNotFoundError("round");

src/http/api/v1/matches.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,14 @@ export const createHandler = (config: HttpApiConfig): express.Router => {
124124
) {
125125
const chainId = Number(req.params.chainId);
126126
const roundId = req.params.roundId;
127-
const potentialVotes = potentialVotesSchema
128-
.parse((req.body as { potentialVotes: PotentialVotes }).potentialVotes)
129-
.map((vote) => ({
130-
...vote,
131-
amount: BigInt(vote.amount),
132-
}));
127+
const potentialVotes = potentialVotesSchema.parse(req.body).map((vote) => ({
128+
...vote,
129+
amount: vote.amount,
130+
}));
133131

134132
const chainConfig = config.chains.find((c) => c.id === chainId);
135133
if (chainConfig === undefined) {
136-
throw new Error(`Chain ${chainId} not configured`);
134+
throw new ClientError(`Chain ${chainId} not configured`, 400);
137135
}
138136

139137
const calculatorOptions: CalculatorOptions = {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ async function catchupAndWatchChain(
168168
// Force a full re-indexing on every startup.
169169
// XXX For the longer term, verify whether ChainSauce supports
170170
// any sort of stop-and-resume.
171-
await fs.rm(CHAIN_DIR_PATH, { force: true, recursive: true });
171+
// await fs.rm(CHAIN_DIR_PATH, { force: true, recursive: true });
172172

173173
const storage = new JsonStorage(CHAIN_DIR_PATH);
174174

src/test/http/app.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ describe("server", () => {
326326
expect(resp.body).toEqual(expectedResults);
327327
});
328328

329-
test.only("should estimate matching with new votes for projects", async () => {
329+
test("should estimate matching with new votes for projects", async () => {
330330
const expectedResults = [
331331
{
332332
applicationId: "application-id-1",

0 commit comments

Comments
 (0)