From 7f42ec577c5102c217f012bec2f84d7dd90a0d0d Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 9 Apr 2025 16:20:26 +0200 Subject: [PATCH] Update prettier to the last version --- package-lock.json | 46 ++++++++++++++++++++++++++++++----- package.json | 6 ++--- test/Periods.test.js | 2 +- test/Proofs.test.js | 18 +++++++------- test/SlotReservations.test.js | 16 ++++++------ test/marketplace.js | 6 ++--- test/requests.js | 6 ++--- 7 files changed, 67 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba43a6d..c8696a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "chai": "^4.3.7", "ethers": "6.14.3", "hardhat": "^2.24.2", - "prettier": "^2.8.2", + "prettier": "^3.5.3", "prettier-plugin-solidity": "^1.4.2", "solhint": "^5.0.5" } @@ -13370,15 +13370,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -14298,6 +14298,23 @@ "node": ">=10" } }, + "node_modules/solhint/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/solhint/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -15106,6 +15123,23 @@ "dev": true, "peer": true }, + "node_modules/typechain/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/typechain/node_modules/ts-essentials": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", diff --git a/package.json b/package.json index 3ce8261..8d2c6ff 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "fuzz": "hardhat compile && fuzzing/fuzz.sh", "start": "hardhat node", "compile": "hardhat compile", - "format": "prettier --write contracts/*.sol contracts/**/*.sol test/**/*.js", - "format:check": "prettier --check contracts/*.sol contracts/**/*.sol test/**/*.js", + "format": "prettier --write test/**/*.js --plugin=prettier-plugin-solidity contracts/**/*.sol ", + "format:check": "prettier --check test/**/*.js --plugin=prettier-plugin-solidity contracts/**/*.sol", "lint": "solhint contracts/**.sol", "deploy": "npx hardhat run scripts/deploy.js", "verify": "npm run verify:marketplace && npm run verify:state_changes", @@ -24,7 +24,7 @@ "chai": "^4.3.7", "ethers": "6.14.3", "hardhat": "^2.24.2", - "prettier": "^2.8.2", + "prettier": "^3.5.3", "prettier-plugin-solidity": "^1.4.2", "solhint": "^5.0.5" } diff --git a/test/Periods.test.js b/test/Periods.test.js index 390b9fc..49ac84d 100644 --- a/test/Periods.test.js +++ b/test/Periods.test.js @@ -17,7 +17,7 @@ describe("Periods", function () { .to.have.property("message") .that.contains( expectedError, - `Expected error ${expectedError}, but got ${error.message}` + `Expected error ${expectedError}, but got ${error.message}`, ) }) diff --git a/test/Proofs.test.js b/test/Proofs.test.js index aca932d..b06423d 100644 --- a/test/Proofs.test.js +++ b/test/Proofs.test.js @@ -212,14 +212,14 @@ describe("Proofs", function () { it("fails proof submission when proof is incorrect", async function () { let invalid = exampleProof() await expect( - proofs.proofReceived(slotId, invalid, pubSignals) + proofs.proofReceived(slotId, invalid, pubSignals), ).to.be.revertedWithCustomError(proofs, "Proofs_InvalidProof") }) it("fails proof submission when public input is incorrect", async function () { let invalid = [1, 2, 3] await expect( - proofs.proofReceived(slotId, proof, invalid) + proofs.proofReceived(slotId, proof, invalid), ).to.be.revertedWithCustomError(proofs, "Proofs_InvalidProof") }) @@ -232,7 +232,7 @@ describe("Proofs", function () { it("fails proof submission when already submitted", async function () { await proofs.proofReceived(slotId, proof, pubSignals) await expect( - proofs.proofReceived(slotId, proof, pubSignals) + proofs.proofReceived(slotId, proof, pubSignals), ).to.be.revertedWithCustomError(proofs, "Proofs_ProofAlreadySubmitted") }) @@ -249,7 +249,7 @@ describe("Proofs", function () { await waitUntilProofIsRequired(slotId) let currentPeriod = periodOf(await currentTime()) await expect( - proofs.markProofAsMissing(slotId, currentPeriod) + proofs.markProofAsMissing(slotId, currentPeriod), ).to.be.revertedWithCustomError(proofs, "Proofs_PeriodNotEnded") }) @@ -258,7 +258,7 @@ describe("Proofs", function () { let currentPeriod = periodOf(await currentTime()) await advanceTimeTo(periodEnd(currentPeriod) + timeout + 1) await expect( - proofs.markProofAsMissing(slotId, currentPeriod) + proofs.markProofAsMissing(slotId, currentPeriod), ).to.be.revertedWithCustomError(proofs, "Proofs_ValidationTimedOut") }) @@ -268,7 +268,7 @@ describe("Proofs", function () { await proofs.proofReceived(slotId, proof, pubSignals) await advanceTimeTo(periodEnd(receivedPeriod) + 1) await expect( - proofs.markProofAsMissing(slotId, receivedPeriod) + proofs.markProofAsMissing(slotId, receivedPeriod), ).to.be.revertedWithCustomError(proofs, "Proofs_ProofNotMissing") }) @@ -279,7 +279,7 @@ describe("Proofs", function () { let currentPeriod = periodOf(await currentTime()) await advanceTimeTo(periodEnd(currentPeriod) + 1) await expect( - proofs.markProofAsMissing(slotId, currentPeriod) + proofs.markProofAsMissing(slotId, currentPeriod), ).to.be.revertedWithCustomError(proofs, "Proofs_ProofNotRequired") }) @@ -289,10 +289,10 @@ describe("Proofs", function () { await advanceTimeTo(periodEnd(missedPeriod) + 1) await proofs.markProofAsMissing(slotId, missedPeriod) await expect( - proofs.markProofAsMissing(slotId, missedPeriod) + proofs.markProofAsMissing(slotId, missedPeriod), ).to.be.revertedWithCustomError( proofs, - "Proofs_ProofAlreadyMarkedMissing" + "Proofs_ProofAlreadyMarkedMissing", ) }) diff --git a/test/SlotReservations.test.js b/test/SlotReservations.test.js index a3a1cf0..5817888 100644 --- a/test/SlotReservations.test.js +++ b/test/SlotReservations.test.js @@ -24,7 +24,7 @@ describe("SlotReservations", function () { configuration: config.reservations, }, }, - } + }, ) reservations = testSlotReservations @@ -86,10 +86,10 @@ describe("SlotReservations", function () { it("cannot reserve a slot more than once", async function () { await reservations.reserveSlot(reqId, slotIndex) await expect( - reservations.reserveSlot(reqId, slotIndex) + reservations.reserveSlot(reqId, slotIndex), ).to.be.revertedWithCustomError( reservations, - "SlotReservations_ReservationNotAllowed" + "SlotReservations_ReservationNotAllowed", ) expect(await reservations.length(id)).to.equal(1) }) @@ -108,10 +108,10 @@ describe("SlotReservations", function () { await reservations.reserveSlot(reqId, slotIndex) switchAccount(provider) await expect( - reservations.reserveSlot(reqId, slotIndex) + reservations.reserveSlot(reqId, slotIndex), ).to.be.revertedWithCustomError( reservations, - "SlotReservations_ReservationNotAllowed" + "SlotReservations_ReservationNotAllowed", ) expect(await reservations.length(id)).to.equal(3) expect(await reservations.contains(id, provider.address)).to.be.false @@ -131,10 +131,10 @@ describe("SlotReservations", function () { it("cannot reserve a slot if not free or not in repair", async function () { await reservations.setSlotState(id, SlotState.Filled) await expect( - reservations.reserveSlot(reqId, slotIndex) + reservations.reserveSlot(reqId, slotIndex), ).to.be.revertedWithCustomError( reservations, - "SlotReservations_ReservationNotAllowed" + "SlotReservations_ReservationNotAllowed", ) expect(await reservations.length(id)).to.equal(0) }) @@ -157,7 +157,7 @@ describe("SlotReservations", function () { it("should not emit an event when reservations are not full", async function () { await expect(reservations.reserveSlot(reqId, slotIndex)).to.not.emit( reservations, - "SlotReservationsFull" + "SlotReservationsFull", ) }) }) diff --git a/test/marketplace.js b/test/marketplace.js index b1310c7..df9ca8a 100644 --- a/test/marketplace.js +++ b/test/marketplace.js @@ -22,7 +22,7 @@ async function waitUntilSlotsFilled(contract, request, proof, token, slots) { payouts[slotIndex] = payoutForDuration( request, await currentTime(), - requestEnd + requestEnd, ) } @@ -35,7 +35,7 @@ async function waitUntilStarted(contract, request, proof, token) { request, proof, token, - Array.from({ length: request.ask.slots }, (_, i) => i) + Array.from({ length: request.ask.slots }, (_, i) => i), ) } @@ -72,7 +72,7 @@ function patchOverloads(contract) { if (logicalXor(rewardRecipient, collateralRecipient)) { // XOR, if exactly one is truthy throw new Error( - "Invalid freeSlot overload, you must specify both `rewardRecipient` and `collateralRecipient` or neither." + "Invalid freeSlot overload, you must specify both `rewardRecipient` and `collateralRecipient` or neither.", ) } diff --git a/test/requests.js b/test/requests.js index 15fb0e7..bee33c2 100644 --- a/test/requests.js +++ b/test/requests.js @@ -28,21 +28,21 @@ function enableRequestAssertions() { "expected request #{this} to have client #{exp} but got #{act}", "expected request #{this} to not have client #{act}, expected #{exp}", request.client, // expected - actual.client // actual + actual.client, // actual ) this.assert( actual.expiry == request.expiry, "expected request #{this} to have expiry #{exp} but got #{act}", "expected request #{this} to not have expiry #{act}, expected #{exp}", request.expiry, // expected - actual.expiry // actual + actual.expiry, // actual ) this.assert( actual.nonce === request.nonce, "expected request #{this} to have nonce #{exp} but got #{act}", "expected request #{this} to not have nonce #{act}, expected #{exp}", request.nonce, // expected - actual.nonce // actual + actual.nonce, // actual ) }) }