-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from The-Poolz/issue-109
added prettier config, formatted files
- Loading branch information
Showing
14 changed files
with
523 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "*.sol", | ||
"options": { | ||
"printWidth": 80, | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"singleQuote": false, | ||
"bracketSpacing": false, | ||
"explicitTypes": "always" | ||
} | ||
}, | ||
{ | ||
"files": "*.js", | ||
"options": { | ||
"printWidth": 120, | ||
"useTabs": false, | ||
"tabWidth": 4, | ||
"semi": false, | ||
"singleQuote": false, | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"bracketSameLine": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "poolz-helper-v2/contracts/token/ERC20Token.sol"; | ||
import "poolz-helper-v2/contracts/token/ERC20Token.sol"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
const LockedDealV2 = artifacts.require("LockedDealV2") | ||
const TestToken = artifacts.require("ERC20Token") | ||
const { assert } = require('chai') | ||
const constants = require('@openzeppelin/test-helpers/src/constants.js'); | ||
const { assert } = require("chai") | ||
const constants = require("@openzeppelin/test-helpers/src/constants.js") | ||
|
||
contract('LockedDealV2', (accounts) => { | ||
contract("LockedDealV2", (accounts) => { | ||
let instance, Token | ||
const allow = 1, owner = accounts[2] | ||
const allow = 1, | ||
owner = accounts[2] | ||
const date = new Date() | ||
|
||
before(async () => { | ||
instance = await LockedDealV2.deployed() | ||
Token = await TestToken.new('TestToken', 'TEST') | ||
Token = await TestToken.new("TestToken", "TEST") | ||
}) | ||
|
||
it('Lock 1 test token for account2 from acount 0', async () => { | ||
it("Lock 1 test token for account2 from acount 0", async () => { | ||
await Token.approve(instance.address, constants.MAX_UINT256) | ||
date.setDate(date.getDate() + 1) // add a day | ||
date.setDate(date.getDate() + 1) // add a day | ||
const startTime = Math.floor(date.getTime() / 1000) | ||
const finishTime = startTime + 60 * 60 * 24 * 30 | ||
await instance.CreateNewPool(Token.address, startTime, finishTime, allow, owner) | ||
const mypoolz = await instance.GetAllMyPoolsId(owner, { from: owner }) | ||
assert.equal(mypoolz.length, 1) | ||
}) | ||
|
||
it('fail on withdraw from account 2', async () => { | ||
it("fail on withdraw from account 2", async () => { | ||
let took = await instance.WithdrawToken.call(0) | ||
assert.isFalse(took) | ||
}) | ||
|
||
it('open new pool for account 1 ', async () => { | ||
it("open new pool for account 1 ", async () => { | ||
const date = new Date() | ||
date.setDate(date.getDate() - 1) // sub a day | ||
date.setDate(date.getDate() - 1) // sub a day | ||
const startTime = Math.floor(date.getTime() / 1000) | ||
const finishTime = startTime + 60 * 60 * 24 * 30 | ||
await instance.CreateNewPool(Token.address, startTime, finishTime, allow, accounts[1]) | ||
const mypoolz = await instance.GetAllMyPoolsId(owner, { from: accounts[1] }) | ||
assert.equal(mypoolz.length, 1) | ||
}) | ||
|
||
it('withdraw from account 1', async () => { | ||
it("withdraw from account 1", async () => { | ||
let took = await instance.WithdrawToken.call(1) | ||
assert.isTrue(took) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.