Skip to content

Commit

Permalink
Update the Acre unit tests
Browse files Browse the repository at this point in the history
Rename `token` -> `tbtc`.
  • Loading branch information
r-czajkowski committed Nov 28, 2023
1 parent f1a126b commit 684d667
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/test/Acre.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ async function acreFixture() {

describe("Acre", () => {
let acre: Acre
let token: TestToken
let tbtc: TestToken
let tokenHolder: HardhatEthersSigner

beforeEach(async () => {
;({ acre, token, tokenHolder } = await loadFixture(acreFixture))
;({ acre, token: tbtc, tokenHolder } = await loadFixture(acreFixture))
})

describe("Staking", () => {
Expand All @@ -35,14 +35,14 @@ describe("Acre", () => {
context("when staking via Acre contract", () => {
beforeEach(async () => {
// Infinite approval for staking contract.
await token
await tbtc
.connect(tokenHolder)
.approve(await acre.getAddress(), ethers.MaxUint256)
})

it("should stake tokens and receive shares", async () => {
const tokenHolderAddress = tokenHolder.address
const amountToStake = await token.balanceOf(tokenHolderAddress)
const amountToStake = await tbtc.balanceOf(tokenHolderAddress)

await expect(
acre
Expand All @@ -63,7 +63,7 @@ describe("Acre", () => {
amountToStake,
)
expect(await acre.balanceOf(tokenHolderAddress)).to.be.eq(amountToStake)
expect(await token.balanceOf(tokenHolderAddress)).to.be.eq(0)
expect(await tbtc.balanceOf(tokenHolderAddress)).to.be.eq(0)
})

it("should revert if the referrer is zero valu", async () => {
Expand Down Expand Up @@ -107,7 +107,7 @@ describe("Acre", () => {
)

await expect(
token
tbtc
.connect(tokenHolder)
.approveAndCall(acreAddress, 1, invalidExtraData),
).to.be.revertedWith("Corrupted stake data")
Expand Down

0 comments on commit 684d667

Please sign in to comment.