Skip to content

Commit

Permalink
test existing add-program functionality
Browse files Browse the repository at this point in the history
well, some of it at least
  • Loading branch information
plaintextpaco committed Nov 14, 2022
1 parent bfe9193 commit d533d3c
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion test/deployments.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { expect } from "chai";
import { AbiCoder } from "ethers/lib/utils";
import { deployments, ethers } from "hardhat";
import { deployments, ethers, run } from "hardhat";
import {
AludelFactory,
Aludel,
CrucibleFactory,
MockERC20,
PowerSwitchFactory,
RewardPoolFactory,
} from "../typechain-types";
import { GEYSER_V2_VANITY_ADDRESS } from "../constants";
import { DAYS } from "./utils";

describe("Aludel factory deployments", function () {
Expand Down Expand Up @@ -48,6 +50,31 @@ describe("Aludel factory deployments", function () {
const factory = await ethers.getContractFactory("MockERC20");
return (await factory.deploy(name, "MockERC20")) as MockERC20;
}
describe("GIVEN a preexisting program", () => {
let preexistingProgram: Aludel;
beforeEach(async () => {
const ethersFactory = await ethers.getContractFactory(
"src/contracts/aludel/Aludel.sol:Aludel"
);
preexistingProgram = (await ethersFactory.deploy()) as Aludel;
});
describe("WHEN adding it with the add-program task, AND passing al parameters", () => {
beforeEach(async () => {
await run("add-program", {
aludelFactory: factory.address,
program: preexistingProgram.address,
template: GEYSER_V2_VANITY_ADDRESS,
name: "some name",
stakingTokenUrl: "http://buy.here",
startTime: "69",
});
});
it("THEN it is listed", async () => {
const program = await factory.programs(preexistingProgram.address);
expect(program.name).to.eq("some name");
});
});
});

describe("GIVEN a PowerSwitchFactory, a CrucibleFactory, a RewardPoolFactory, and some other stuff", () => {
let powerSwitchFactory: PowerSwitchFactory;
Expand Down

0 comments on commit d533d3c

Please sign in to comment.