Skip to content

Commit

Permalink
cooldown integration test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyabukalov committed Jun 22, 2022
1 parent c2ce0c0 commit 5c1b293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/futures-market.clar
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ u20
)

;; FIXME adjust to final update cooldown value
(define-constant POSITION_UPDATE_COOLDOWN u86400) ;; seconds in a day
(define-constant POSITION_UPDATE_COOLDOWN u60) ;; seconds

;; FIXME adjust to proper final value
(define-constant POSITION_MAX_DURATION u10) ;; number of days a position can be held
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/test_pool/futures_position.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as fs from "fs";
import * as path from "path";
import { CONTRACT_FOLDER, TRAITS_FOLDER, STACKS_API_URL } from "../config";
import { StacksChain } from "dy-finance.lib";
const POSITION_UPDATE_COOLDOWN = 60000; // ms

describe("futures position", () => {
const chain = new StacksChain(STACKS_API_URL, {
Expand Down Expand Up @@ -155,6 +156,8 @@ describe("futures position", () => {
expect(insertPosition).to.be.ok;
}

await new Promise(r => setTimeout(r, POSITION_UPDATE_COOLDOWN));

const batchPositionMaintenance = await chain.callContract(
deployer.address,
futuresMarketContractName,
Expand Down

0 comments on commit 5c1b293

Please sign in to comment.