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
26127ee3
Commit
26127ee3
authored
Jan 23, 2017
by
Manuel Aráoz
Committed by
GitHub
Jan 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #136 from AragonOne/master
Make test cases that use assertJump fail if they dont fail
parents
ad833fb4
2f0471ff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
BasicToken.js
test/BasicToken.js
+2
-1
LimitBalance.js
test/LimitBalance.js
+4
-2
SafeMath.js
test/SafeMath.js
+6
-3
StandardToken.js
test/StandardToken.js
+4
-2
No files found.
test/BasicToken.js
View file @
26127ee3
...
...
@@ -25,8 +25,9 @@ contract('BasicToken', function(accounts) {
try
{
let
transfer
=
await
token
.
transfer
(
accounts
[
1
],
101
);
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
});
test/LimitBalance.js
View file @
26127ee3
...
...
@@ -26,8 +26,9 @@ contract('LimitBalance', function(accounts) {
try
{
let
limDeposit
=
await
lb
.
limitedDeposit
({
value
:
amount
});
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
it
(
"should allow multiple sends below limit"
,
async
function
()
{
...
...
@@ -49,8 +50,9 @@ contract('LimitBalance', function(accounts) {
try
{
await
lb
.
limitedDeposit
({
value
:
amount
+
1
})
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
});
test/SafeMath.js
View file @
26127ee3
...
...
@@ -40,8 +40,9 @@ contract('SafeMath', function(accounts) {
try
{
let
subtract
=
await
safeMath
.
subtract
(
a
,
b
);
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
it
(
"should throw an error on addition overflow"
,
async
function
()
{
...
...
@@ -50,8 +51,9 @@ contract('SafeMath', function(accounts) {
try
{
let
add
=
await
safeMath
.
add
(
a
,
b
);
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
it
(
"should throw an error on multiplication overflow"
,
async
function
()
{
...
...
@@ -60,8 +62,9 @@ contract('SafeMath', function(accounts) {
try
{
let
multiply
=
await
safeMath
.
multiply
(
a
,
b
);
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
});
test/StandardToken.js
View file @
26127ee3
...
...
@@ -32,8 +32,9 @@ contract('StandardToken', function(accounts) {
try
{
let
transfer
=
await
token
.
transfer
(
accounts
[
1
],
101
);
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
it
(
"should return correct balances after transfering from another account"
,
async
function
()
{
...
...
@@ -57,8 +58,9 @@ contract('StandardToken', function(accounts) {
try
{
let
transfer
=
await
token
.
transferFrom
(
accounts
[
0
],
accounts
[
2
],
100
,
{
from
:
accounts
[
1
]});
}
catch
(
error
)
{
assertJump
(
error
);
return
assertJump
(
error
);
}
assert
.
fail
(
'should have thrown before'
);
});
});
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