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
ea1cb5c5
Commit
ea1cb5c5
authored
Jan 15, 2018
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing awaits in tests
parent
beea818f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
Bounty.test.js
test/Bounty.test.js
+2
-2
RBAC.test.js
test/RBAC.test.js
+7
-7
No files found.
test/Bounty.test.js
View file @
ea1cb5c5
...
@@ -74,7 +74,7 @@ contract('Bounty', function (accounts) {
...
@@ -74,7 +74,7 @@ contract('Bounty', function (accounts) {
web3
.
eth
.
getBalance
(
bounty
.
address
).
toNumber
());
web3
.
eth
.
getBalance
(
bounty
.
address
).
toNumber
());
}
}
};
};
bounty
.
createTarget
({
from
:
researcher
});
await
bounty
.
createTarget
({
from
:
researcher
});
await
awaitEvent
(
event
,
watcher
);
await
awaitEvent
(
event
,
watcher
);
});
});
});
});
...
@@ -104,7 +104,7 @@ contract('Bounty', function (accounts) {
...
@@ -104,7 +104,7 @@ contract('Bounty', function (accounts) {
assert
.
equal
(
0
,
web3
.
eth
.
getBalance
(
bounty
.
address
).
toNumber
());
assert
.
equal
(
0
,
web3
.
eth
.
getBalance
(
bounty
.
address
).
toNumber
());
};
};
bounty
.
createTarget
({
from
:
researcher
});
await
bounty
.
createTarget
({
from
:
researcher
});
await
awaitEvent
(
event
,
watcher
);
await
awaitEvent
(
event
,
watcher
);
});
});
});
});
...
...
test/RBAC.test.js
View file @
ea1cb5c5
...
@@ -45,17 +45,17 @@ contract('RBAC', function (accounts) {
...
@@ -45,17 +45,17 @@ contract('RBAC', function (accounts) {
.
should
.
be
.
fulfilled
;
.
should
.
be
.
fulfilled
;
});
});
it
(
'does not allow admins to call #nobodyCanDoThis'
,
async
()
=>
{
it
(
'does not allow admins to call #nobodyCanDoThis'
,
async
()
=>
{
expectThrow
(
await
expectThrow
(
mock
.
nobodyCanDoThis
({
from
:
admin
})
mock
.
nobodyCanDoThis
({
from
:
admin
})
);
);
});
});
it
(
'does not allow advisors to call #nobodyCanDoThis'
,
async
()
=>
{
it
(
'does not allow advisors to call #nobodyCanDoThis'
,
async
()
=>
{
expectThrow
(
await
expectThrow
(
mock
.
nobodyCanDoThis
({
from
:
advisors
[
0
]
})
mock
.
nobodyCanDoThis
({
from
:
advisors
[
0
]
})
);
);
});
});
it
(
'does not allow anyone to call #nobodyCanDoThis'
,
async
()
=>
{
it
(
'does not allow anyone to call #nobodyCanDoThis'
,
async
()
=>
{
expectThrow
(
await
expectThrow
(
mock
.
nobodyCanDoThis
({
from
:
anyone
})
mock
.
nobodyCanDoThis
({
from
:
anyone
})
);
);
});
});
...
@@ -69,14 +69,14 @@ contract('RBAC', function (accounts) {
...
@@ -69,14 +69,14 @@ contract('RBAC', function (accounts) {
});
});
it
(
'announces a RoleAdded event on addRole'
,
async
()
=>
{
it
(
'announces a RoleAdded event on addRole'
,
async
()
=>
{
expectEvent
.
inTransaction
(
await
expectEvent
.
inTransaction
(
mock
.
adminAddRole
(
futureAdvisor
,
ROLE_ADVISOR
,
{
from
:
admin
}),
mock
.
adminAddRole
(
futureAdvisor
,
ROLE_ADVISOR
,
{
from
:
admin
}),
'RoleAdded'
'RoleAdded'
);
);
});
});
it
(
'announces a RoleRemoved event on removeRole'
,
async
()
=>
{
it
(
'announces a RoleRemoved event on removeRole'
,
async
()
=>
{
expectEvent
.
inTransaction
(
await
expectEvent
.
inTransaction
(
mock
.
adminRemoveRole
(
futureAdvisor
,
ROLE_ADVISOR
,
{
from
:
admin
}),
mock
.
adminRemoveRole
(
futureAdvisor
,
ROLE_ADVISOR
,
{
from
:
admin
}),
'RoleRemoved'
'RoleRemoved'
);
);
...
@@ -85,12 +85,12 @@ contract('RBAC', function (accounts) {
...
@@ -85,12 +85,12 @@ contract('RBAC', function (accounts) {
context
(
'in adversarial conditions'
,
()
=>
{
context
(
'in adversarial conditions'
,
()
=>
{
it
(
'does not allow an advisor to remove another advisor'
,
async
()
=>
{
it
(
'does not allow an advisor to remove another advisor'
,
async
()
=>
{
expectThrow
(
await
expectThrow
(
mock
.
removeAdvisor
(
advisors
[
1
],
{
from
:
advisors
[
0
]
})
mock
.
removeAdvisor
(
advisors
[
1
],
{
from
:
advisors
[
0
]
})
);
);
});
});
it
(
'does not allow "anyone" to remove an advisor'
,
async
()
=>
{
it
(
'does not allow "anyone" to remove an advisor'
,
async
()
=>
{
expectThrow
(
await
expectThrow
(
mock
.
removeAdvisor
(
advisors
[
0
],
{
from
:
anyone
})
mock
.
removeAdvisor
(
advisors
[
0
],
{
from
:
anyone
})
);
);
});
});
...
...
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