mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-01-07 15:53:07 +00:00
vault: make tests a bit more robust
This commit is contained in:
parent
eff9cc1acb
commit
41005cf42c
@ -401,7 +401,7 @@ describe("Vault", function () {
|
|||||||
|
|
||||||
describe("flow", function () {
|
describe("flow", function () {
|
||||||
const context = randomBytes(32)
|
const context = randomBytes(32)
|
||||||
const deposit = 100
|
const deposit = 1000
|
||||||
|
|
||||||
let sender
|
let sender
|
||||||
let receiver
|
let receiver
|
||||||
@ -511,9 +511,9 @@ describe("Vault", function () {
|
|||||||
|
|
||||||
it("rejects flow when insufficient available tokens", async function () {
|
it("rejects flow when insufficient available tokens", async function () {
|
||||||
const duration = maximum - (await currentTime())
|
const duration = maximum - (await currentTime())
|
||||||
const rate = Math.round(deposit / duration)
|
const rate = Math.ceil(deposit / duration) + 1
|
||||||
await expect(
|
await expect(
|
||||||
vault.flow(context, sender, receiver, rate + 1)
|
vault.flow(context, sender, receiver, rate)
|
||||||
).to.be.revertedWith("InsufficientBalance")
|
).to.be.revertedWith("InsufficientBalance")
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ describe("Vault", function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("cannot flow designated tokens", async function () {
|
it("cannot flow designated tokens", async function () {
|
||||||
await vault.designate(context, sender, 10)
|
await vault.designate(context, sender, deposit / 2)
|
||||||
const duration = maximum - (await currentTime())
|
const duration = maximum - (await currentTime())
|
||||||
const rate = Math.round(deposit / duration)
|
const rate = Math.round(deposit / duration)
|
||||||
await expect(
|
await expect(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user