Skip to content

Commit

Permalink
Testing direct return of depositBalance plus any donations
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpar committed May 7, 2024
1 parent bb42bce commit c5e767e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions solidity/test/MezoAllocator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ describe("MezoAllocator", () => {
})

context("when there is a deposit", () => {
beforeAfterSnapshotWrapper()

before(async () => {
await tbtc.mint(await stbtc.getAddress(), to1e18(5))
await mezoAllocator.connect(maintainer).allocate()
Expand All @@ -372,6 +374,22 @@ describe("MezoAllocator", () => {
expect(await mezoAllocator.totalAssets()).to.equal(depositBalance)
})
})

context("when there is a deposit plus 'donation' made", () => {
beforeAfterSnapshotWrapper()

before(async () => {
await tbtc.mint(await stbtc.getAddress(), to1e18(5))
await mezoAllocator.connect(maintainer).allocate()
// donation
await tbtc.mint(await mezoAllocator.getAddress(), to1e18(1))
})

it("should return the total assets value", async () => {
const totalAssets = await mezoAllocator.totalAssets()
expect(totalAssets).to.equal(to1e18(6))
})
})
})

describe("addMaintainer", () => {
Expand Down

0 comments on commit c5e767e

Please sign in to comment.