Skip to content

Commit

Permalink
[#4] Create constant.ts file, add new line in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Jun 30, 2023
1 parent 6b4efde commit 69613fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/SafeProtocolMediator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import hre from "hardhat";
import { loadFixture } from "@nomicfoundation/hardhat-toolbox/network-helpers";
import { expect } from "chai";
import { ZeroAddress } from "ethers";
import { SENTINEL_MODULES } from "./utils/constants";

describe("SafeProtocolMediator", async () => {
const SENTINEL_MODULES = "0x0000000000000000000000000000000000000001";
const [deployer, user1] = await hre.ethers.getSigners();

async function deployContractFixture() {
Expand Down Expand Up @@ -70,7 +70,7 @@ describe("SafeProtocolMediator", async () => {

describe("Test disable module", async () => {
it("Should not allow a Safe to disable zero address module", async () => {
const { safeProtocolMediator, safe, module } = await loadFixture(deployContractsFixture);
const { safeProtocolMediator, safe } = await loadFixture(deployContractsFixture);
await safe.setModule(await safeProtocolMediator.getAddress());
const data = safeProtocolMediator.interface.encodeFunctionData("disableModule", [
hre.ethers.ZeroAddress,
Expand Down Expand Up @@ -119,6 +119,7 @@ describe("SafeProtocolMediator", async () => {
await safe.exec(safeProtocolMediatorAddress, 0, data2);
expect(await safeProtocolMediator.getModuleInfo(safeAddress, moduleAddress)).to.eql([false, ZeroAddress]);
});

it("Should not allow enabling module if already enabled", async () => {
const { safeProtocolMediator, safe, module } = await loadFixture(deployContractsFixture);
const safeProtocolMediatorAddress = await safeProtocolMediator.getAddress();
Expand Down
1 change: 1 addition & 0 deletions test/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SENTINEL_MODULES = "0x0000000000000000000000000000000000000001";

0 comments on commit 69613fc

Please sign in to comment.