Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
696615d3
Commit
696615d3
authored
Sep 28, 2017
by
Martín Triay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TokenVesting] Add linear release test
parent
645edfc9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
TokenVesting.js
test/TokenVesting.js
+14
-1
No files found.
test/TokenVesting.js
View file @
696615d3
...
...
@@ -48,7 +48,20 @@ contract('TokenVesting', function ([_, owner, beneficiary]) {
balance
.
should
.
bignumber
.
equal
(
amount
.
mul
(
releaseTime
-
this
.
start
).
div
(
this
.
end
-
this
.
start
).
floor
());
});
it
(
'should linearly release tokens during vesting period'
);
it
(
'should linearly release tokens during vesting period'
,
async
function
()
{
const
duration
=
this
.
end
-
this
.
cliff
;
const
checkpoints
=
4
;
for
(
let
i
=
1
;
i
<=
checkpoints
;
i
++
)
{
const
now
=
this
.
cliff
+
i
*
(
duration
/
checkpoints
);
await
increaseTimeTo
(
now
);
const
vested
=
await
this
.
vesting
.
vestedAmount
(
this
.
token
.
address
);
const
expectedVesting
=
amount
.
mul
(
now
-
this
.
start
).
div
(
this
.
end
-
this
.
start
).
floor
();
vested
.
should
.
bignumber
.
equal
(
expectedVesting
);
}
});
it
(
'should have released all after end'
,
async
function
()
{
await
increaseTimeTo
(
this
.
end
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment