Skip to content

Commit

Permalink
Formatting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Nov 8, 2023
1 parent 833f1ae commit 8a5f56d
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 61 deletions.
2 changes: 1 addition & 1 deletion packages/contracts/.solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.4"],
"func-visibility": ["error", {"ignoreConstructors": true}],
"max-line-length": ["error", 120],
"max-line-length": ["warn", 120],
"named-parameters-mapping": "warn",
"no-console": "off",
"not-rely-on-time": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"coverage": "hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"test/**/*.ts\" && yarn typechain",
"deploy": "hardhat deploy",
"lint": "yarn lint:sol && yarn lint:ts",
"lint:sol": "solhint --max-warnings 0 \"src/**/*.sol\"",
"lint:sol": "solhint \"src/**/*.sol\"",
"lint:ts": "eslint --ignore-path ./.eslintignore --ext .js,.ts .",
"postinstall": "DOTENV_CONFIG_PATH=../../.env.example yarn typechain",
"test": "hardhat test",
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/integration-testing/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
PersonalSpaceAdminPluginSetupParams,
SpacePluginSetupParams,
} from "../../plugin-setup-params";
import { toHex } from "../../utils/ipfs";
// import { toHex } from "../../utils/ipfs";
import { PluginRepoRegistry__factory } from "@aragon/osx-ethers";
import { PluginRepoRegistry } from "@aragon/osx-ethers";
import { PluginRepo__factory } from "@aragon/osx-ethers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { osxContracts } from "../../utils/helpers";
import { getPluginRepoInfo } from "../../utils/plugin-repo-info";
import { installPlugin, uninstallPlugin } from "../helpers/setup";
import { deployTestDao } from "../helpers/test-dao";
import { getNamedTypesFromMetadata } from "../helpers/types";
// import { getNamedTypesFromMetadata } from "../helpers/types";
import {
DAO,
PluginRepo__factory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { osxContracts } from "../../utils/helpers";
import { getPluginRepoInfo } from "../../utils/plugin-repo-info";
import { installPlugin, uninstallPlugin } from "../helpers/setup";
import { deployTestDao } from "../helpers/test-dao";
import { getNamedTypesFromMetadata } from "../helpers/types";
// import { getNamedTypesFromMetadata } from "../helpers/types";
import {
DAO,
PluginRepo__factory,
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/integration-testing/space-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { osxContracts } from "../../utils/helpers";
import { getPluginRepoInfo } from "../../utils/plugin-repo-info";
import { installPlugin, uninstallPlugin } from "../helpers/setup";
import { deployTestDao } from "../helpers/test-dao";
import { getNamedTypesFromMetadata } from "../helpers/types";
// import { getNamedTypesFromMetadata } from "../helpers/types";
import {
DAO,
PluginRepo__factory,
Expand Down
24 changes: 12 additions & 12 deletions packages/contracts/test/unit-testing/main-voting-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
EMPTY_DATA,
EXECUTE_PERMISSION_ID,
getTime,
MAX_UINT64,
// MAX_UINT64,
MEMBER_PERMISSION_ID,
mineBlock,
pctToRatio,
Expand All @@ -44,7 +44,7 @@ import { ethers } from "hardhat";
import { defaultMainVotingSettings } from "./common";
import { toUtf8Bytes } from "ethers/lib/utils";
import {
ProposalCreatedEvent,
// ProposalCreatedEvent,
ProposalExecutedEvent,
} from "../../typechain/src/MainVotingPlugin";
import { ExecutedEvent } from "../../typechain/@aragon/osx/core/dao/DAO";
Expand Down Expand Up @@ -530,7 +530,7 @@ describe("Main Voting Plugin", function () {

context("Canceling", () => {
it("Proposals created by a member can be canceled before they end", async () => {
let proposalId = 0;
const proposalId = 0;
await expect(
mainVotingPlugin.connect(bob).createProposal(
toUtf8Bytes("ipfs://"),
Expand Down Expand Up @@ -572,7 +572,7 @@ describe("Main Voting Plugin", function () {
await makeEditor(bob.address);
expect(await mainVotingPlugin.addresslistLength()).to.eq(2);

let proposalId = 0;
const proposalId = 0;
await expect(
mainVotingPlugin.connect(bob).createProposal(
toUtf8Bytes("ipfs://"),
Expand Down Expand Up @@ -804,7 +804,7 @@ describe("Main Voting Plugin", function () {
});

it("Proposals can only be canceled by the creator (member)", async () => {
let proposalId = 0;
const proposalId = 0;
await expect(
mainVotingPlugin.connect(bob).createProposal(
toUtf8Bytes("ipfs://"),
Expand Down Expand Up @@ -872,7 +872,7 @@ describe("Main Voting Plugin", function () {
await makeEditor(bob.address);
expect(await mainVotingPlugin.addresslistLength()).to.eq(2);

let proposalId = 0;
const proposalId = 0;
await expect(
mainVotingPlugin.connect(bob).createProposal(
toUtf8Bytes("ipfs://"),
Expand Down Expand Up @@ -978,9 +978,9 @@ describe("Main Voting Plugin", function () {

// Propose removing Bob
await proposeRemoveEditor(bob.address);
expect(await mainVotingPlugin.connect(bob).vote(3, VoteOption.Yes, true))
.to
.not.be.reverted;
await expect(
mainVotingPlugin.connect(bob).vote(3, VoteOption.Yes, true),
).to.not.be.reverted;
expect(await mainVotingPlugin.addresslistLength()).to.eq(1);
});

Expand Down Expand Up @@ -1127,7 +1127,7 @@ describe("Main Voting Plugin", function () {
});

it("Approved proposals can be executed by anyone after passed", async () => {
let pid = 0;
const pid = 0;
await expect(createDummyProposal(bob, false)).to.not.be.reverted;
expect(await mainVotingPlugin.canExecute(pid)).to.eq(false);

Expand Down Expand Up @@ -2087,7 +2087,7 @@ describe("Tests replicated from the original AddressList plugin", async () => {
expect(await mainVotingPlugin.canExecute(id)).to.be.true;

// `tryEarlyExecution` is turned on and the vote is decided
let tx = await mainVotingPlugin
const tx = await mainVotingPlugin
.connect(signers[6])
.vote(id, VoteOption.Abstain, true);
{
Expand Down Expand Up @@ -2656,7 +2656,7 @@ describe("Tests replicated from the original AddressList plugin", async () => {

it("does not execute with 0 votes", async () => {
// does not execute early
advanceIntoVoteTime(startDate, endDate);
await advanceIntoVoteTime(startDate, endDate);

expect(await mainVotingPlugin.isMinParticipationReached(id)).to.be
.true;
Expand Down
18 changes: 9 additions & 9 deletions packages/contracts/test/unit-testing/member-access-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ describe("Member Access Plugin", function () {
dave.address,
),
).to.not.be.reverted;
let pid = 0;
const pid = 0;

let proposal = await memberAccessPlugin.getProposal(pid);
const proposal = await memberAccessPlugin.getProposal(pid);
expect(proposal.executed).to.eq(false);
expect(proposal.parameters.minApprovals).to.eq(1);
expect(await memberAccessPlugin.canExecute(pid)).to.eq(false);
Expand Down Expand Up @@ -864,9 +864,9 @@ describe("Member Access Plugin", function () {
dave.address,
),
).to.not.be.reverted;
let pid = 0;
const pid = 0;

let proposal = await memberAccessPlugin.getProposal(pid);
const proposal = await memberAccessPlugin.getProposal(pid);
expect(proposal.executed).to.eq(false);
expect(proposal.parameters.minApprovals).to.eq(1);
expect(await memberAccessPlugin.canExecute(pid)).to.eq(false);
Expand Down Expand Up @@ -894,7 +894,7 @@ describe("Member Access Plugin", function () {
dave.address,
),
).to.not.be.reverted;
let pid = 0;
const pid = 0;

const proposal = await memberAccessPlugin.getProposal(pid);
expect(proposal.executed).to.eq(false);
Expand Down Expand Up @@ -1122,7 +1122,7 @@ describe("Member Access Plugin", function () {
),
).to.not.be.reverted;

let pid = 0;
const pid = 0;
await expect(memberAccessPlugin.approve(pid, false)).to.not.be.reverted;
await expect(memberAccessPlugin.approve(pid, false)).to.be.reverted;
});
Expand All @@ -1135,7 +1135,7 @@ describe("Member Access Plugin", function () {
),
).to.not.be.reverted;

let pid = 0;
const pid = 0;
await expect(memberAccessPlugin.reject(pid)).to.not.be.reverted;
await expect(memberAccessPlugin.reject(pid)).to.be.reverted;
});
Expand Down Expand Up @@ -1194,7 +1194,7 @@ describe("Member Access Plugin", function () {
),
).to.not.be.reverted;

let pid = 0;
const pid = 0;
await expect(memberAccessPlugin.reject(pid)).to.not.be.reverted;
await expect(memberAccessPlugin.approve(pid, false)).to.be.reverted;
});
Expand All @@ -1207,7 +1207,7 @@ describe("Member Access Plugin", function () {
),
).to.not.be.reverted;

let pid = 0;
const pid = 0;
await expect(memberAccessPlugin.reject(pid)).to.not.be.reverted;
await expect(memberAccessPlugin.execute(pid)).to.be.reverted;
});
Expand Down
57 changes: 26 additions & 31 deletions packages/contracts/test/unit-testing/personal-space-admin-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ describe("Personal Space Admin Plugin", function () {
);

// Alice is an editor
expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
dummyActions,
0,
Expand All @@ -240,8 +240,8 @@ describe("Personal Space Admin Plugin", function () {
});

it("Proposal execution is immediate", async () => {
expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
dummyActions,
0,
Expand All @@ -264,25 +264,25 @@ describe("Personal Space Admin Plugin", function () {
},
];

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actions,
0,
),
).to.emit(personalSpaceVotingPlugin, "ProposalCreated");

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actions,
0,
),
).to.emit(personalSpaceVotingPlugin, "Executed")
.withArgs(1);

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actions,
0,
Expand All @@ -305,25 +305,25 @@ describe("Personal Space Admin Plugin", function () {
},
];

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actions,
0,
),
).to.emit(personalSpaceVotingPlugin, "ProposalCreated");

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actions,
0,
),
).to.emit(personalSpaceVotingPlugin, "Executed")
.withArgs(1);

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actions,
0,
Expand Down Expand Up @@ -362,25 +362,25 @@ describe("Personal Space Admin Plugin", function () {
);

// remove
expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actionsRemove,
0,
),
).to.emit(personalSpaceVotingPlugin, "ProposalCreated");

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actionsRemove,
0,
),
).to.emit(personalSpaceVotingPlugin, "Executed")
.withArgs(2);

expect(
await personalSpaceVotingPlugin.connect(alice).executeProposal(
await expect(
personalSpaceVotingPlugin.connect(alice).executeProposal(
"0x",
actionsRemove,
0,
Expand All @@ -403,8 +403,7 @@ describe("Personal Space Admin Plugin", function () {
await personalSpaceVotingPlugin.supportsInterface(
getInterfaceID(iface),
),
).to.be
.true;
).to.be.true;
});

it("supports the `IPlugin` interface", async () => {
Expand All @@ -413,8 +412,7 @@ describe("Personal Space Admin Plugin", function () {
await personalSpaceVotingPlugin.supportsInterface(
getInterfaceID(iface),
),
).to.be
.true;
).to.be.true;
});

it("supports the `IProposal` interface", async () => {
Expand All @@ -423,18 +421,15 @@ describe("Personal Space Admin Plugin", function () {
await personalSpaceVotingPlugin.supportsInterface(
getInterfaceID(iface),
),
).to.be
.true;
).to.be.true;
});

it("supports the `Admin` interface", async () => {
expect(
await personalSpaceVotingPlugin.supportsInterface(
getInterfaceID(psvpInterface),
),
)
.to
.be.true;
).to.be.true;
});
});

Expand Down
Loading

0 comments on commit 8a5f56d

Please sign in to comment.