Skip to content

Commit

Permalink
update master chef test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy-Alpaca committed Nov 1, 2020
1 parent e600e9f commit b6de7cc
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions test/masterChef.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ describe("MasterChef", () => {
}

context("Basic infos", async () => {
it("has correct owner", async () => {
expect(await masterChef.owner()).to.eq(owner.address);
});

it("has correct alpa token contract", async () => {
expect(await masterChef.alpa()).to.eq(alpaToken.address);
});
Expand All @@ -116,10 +112,6 @@ describe("MasterChef", () => {
expect(await masterChef.startBlock()).to.eq(STARTING_BLOCK);
});

it("ALPA owner is masterChef", async () => {
expect(await alpaToken.owner()).to.eq(masterChef.address);
});

it("has correct empty alpaca energy", async () => {
expect(await masterChef.EMPTY_ALPACA_ENERGY()).to.eq(1);
});
Expand All @@ -130,6 +122,28 @@ describe("MasterChef", () => {
});
});

context("Access control", async () => {
it("has correct owner", async () => {
expect(await masterChef.owner()).to.eq(owner.address);
});

it("ALPA owner is masterChef", async () => {
expect(await alpaToken.owner()).to.eq(masterChef.address);
});

it("can transfer ownership", async () => {
await masterChef.transferOwnership(user1.address);
expect(await masterChef.owner()).to.eq(user1.address);
});

it("can transfer alpa ownership", async () => {
expect(await alpaToken.owner()).to.eq(masterChef.address);

await masterChef.setAlpaOwner(user1.address);
expect(await alpaToken.owner()).to.eq(user1.address);
});
})

context("Alpaca operator update energy", async () => {
let testAlpaca1: ContractAlpaca;
let testAlpaca2: ContractAlpaca;
Expand Down

0 comments on commit b6de7cc

Please sign in to comment.