mirror of
https://github.com/status-im/codex-contracts-eth.git
synced 2025-02-12 08:26:46 +00:00
vault: reject negative flows
This commit is contained in:
parent
8ee4512080
commit
9105a3530a
@ -503,6 +503,12 @@ describe("Vault", function () {
|
||||
expect(await getBalance(receiver)).to.equal(total)
|
||||
})
|
||||
|
||||
it("rejects negative flows", async function() {
|
||||
await expect(
|
||||
vault.flow(context, sender, receiver, -1)
|
||||
).to.be.revertedWith("NegativeFlow")
|
||||
})
|
||||
|
||||
it("rejects flow when insufficient available tokens", async function () {
|
||||
const duration = maximum - (await currentTime())
|
||||
const rate = Math.round(deposit / duration)
|
||||
|
Loading…
x
Reference in New Issue
Block a user