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
15b92e40
Unverified
Commit
15b92e40
authored
Jul 06, 2021
by
Hadrien Croubois
Committed by
GitHub
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing "await" in tests (#2749)
* add missing await in tests * fix test description
parent
922058db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
ERC20FlashMint.test.js
test/token/ERC20/extensions/ERC20FlashMint.test.js
+4
-4
ERC20VotesComp.test.js
test/token/ERC20/extensions/ERC20VotesComp.test.js
+1
-1
ERC20Wrapper.test.js
test/token/ERC20/extensions/ERC20Wrapper.test.js
+12
-12
No files found.
test/token/ERC20/extensions/ERC20FlashMint.test.js
View file @
15b92e40
...
...
@@ -45,10 +45,10 @@ contract('ERC20FlashMint', function (accounts) {
const
receiver
=
await
ERC3156FlashBorrowerMock
.
new
(
true
,
true
);
const
{
tx
}
=
await
this
.
token
.
flashLoan
(
receiver
.
address
,
this
.
token
.
address
,
loanAmount
,
'0x'
);
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
ZERO_ADDRESS
,
to
:
receiver
.
address
,
value
:
loanAmount
});
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
receiver
.
address
,
to
:
ZERO_ADDRESS
,
value
:
loanAmount
});
expectEvent
.
inTransaction
(
tx
,
receiver
,
'BalanceOf'
,
{
token
:
this
.
token
.
address
,
account
:
receiver
.
address
,
value
:
loanAmount
});
expectEvent
.
inTransaction
(
tx
,
receiver
,
'TotalSupply'
,
{
token
:
this
.
token
.
address
,
value
:
initialSupply
.
add
(
loanAmount
)
});
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
ZERO_ADDRESS
,
to
:
receiver
.
address
,
value
:
loanAmount
});
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
receiver
.
address
,
to
:
ZERO_ADDRESS
,
value
:
loanAmount
});
await
expectEvent
.
inTransaction
(
tx
,
receiver
,
'BalanceOf'
,
{
token
:
this
.
token
.
address
,
account
:
receiver
.
address
,
value
:
loanAmount
});
await
expectEvent
.
inTransaction
(
tx
,
receiver
,
'TotalSupply'
,
{
token
:
this
.
token
.
address
,
value
:
initialSupply
.
add
(
loanAmount
)
});
expect
(
await
this
.
token
.
totalSupply
()).
to
.
be
.
bignumber
.
equal
(
initialSupply
);
expect
(
await
this
.
token
.
balanceOf
(
receiver
.
address
)).
to
.
be
.
bignumber
.
equal
(
'0'
);
...
...
test/token/ERC20/extensions/ERC20VotesComp.test.js
View file @
15b92e40
...
...
@@ -52,7 +52,7 @@ async function batchInBlock (txs) {
}
}
contract
(
'ERC20Votes'
,
function
(
accounts
)
{
contract
(
'ERC20Votes
Comp
'
,
function
(
accounts
)
{
const
[
holder
,
recipient
,
holderDelegatee
,
recipientDelegatee
,
other1
,
other2
]
=
accounts
;
const
name
=
'My Token'
;
...
...
test/token/ERC20/extensions/ERC20Wrapper.test.js
View file @
15b92e40
...
...
@@ -44,12 +44,12 @@ contract('ERC20', function (accounts) {
it
(
'valid'
,
async
function
()
{
await
this
.
underlying
.
approve
(
this
.
token
.
address
,
initialSupply
,
{
from
:
initialHolder
});
const
{
tx
}
=
await
this
.
token
.
depositFor
(
initialHolder
,
initialSupply
,
{
from
:
initialHolder
});
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
from
:
initialHolder
,
to
:
this
.
token
.
address
,
value
:
initialSupply
,
});
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
ZERO_ADDRESS
,
to
:
initialHolder
,
value
:
initialSupply
,
...
...
@@ -74,12 +74,12 @@ contract('ERC20', function (accounts) {
it
(
'to other account'
,
async
function
()
{
await
this
.
underlying
.
approve
(
this
.
token
.
address
,
initialSupply
,
{
from
:
initialHolder
});
const
{
tx
}
=
await
this
.
token
.
depositFor
(
anotherAccount
,
initialSupply
,
{
from
:
initialHolder
});
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
from
:
initialHolder
,
to
:
this
.
token
.
address
,
value
:
initialSupply
,
});
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
ZERO_ADDRESS
,
to
:
anotherAccount
,
value
:
initialSupply
,
...
...
@@ -104,12 +104,12 @@ contract('ERC20', function (accounts) {
const
value
=
new
BN
(
42
);
const
{
tx
}
=
await
this
.
token
.
withdrawTo
(
initialHolder
,
value
,
{
from
:
initialHolder
});
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
from
:
this
.
token
.
address
,
to
:
initialHolder
,
value
:
value
,
});
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
initialHolder
,
to
:
ZERO_ADDRESS
,
value
:
value
,
...
...
@@ -118,12 +118,12 @@ contract('ERC20', function (accounts) {
it
(
'entire balance'
,
async
function
()
{
const
{
tx
}
=
await
this
.
token
.
withdrawTo
(
initialHolder
,
initialSupply
,
{
from
:
initialHolder
});
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
from
:
this
.
token
.
address
,
to
:
initialHolder
,
value
:
initialSupply
,
});
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
initialHolder
,
to
:
ZERO_ADDRESS
,
value
:
initialSupply
,
...
...
@@ -132,12 +132,12 @@ contract('ERC20', function (accounts) {
it
(
'to other account'
,
async
function
()
{
const
{
tx
}
=
await
this
.
token
.
withdrawTo
(
anotherAccount
,
initialSupply
,
{
from
:
initialHolder
});
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
underlying
,
'Transfer'
,
{
from
:
this
.
token
.
address
,
to
:
anotherAccount
,
value
:
initialSupply
,
});
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
initialHolder
,
to
:
ZERO_ADDRESS
,
value
:
initialSupply
,
...
...
@@ -151,7 +151,7 @@ contract('ERC20', function (accounts) {
await
this
.
token
.
depositFor
(
initialHolder
,
initialSupply
,
{
from
:
initialHolder
});
const
{
tx
}
=
await
this
.
token
.
recover
(
anotherAccount
);
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
ZERO_ADDRESS
,
to
:
anotherAccount
,
value
:
'0'
,
...
...
@@ -162,7 +162,7 @@ contract('ERC20', function (accounts) {
await
this
.
underlying
.
transfer
(
this
.
token
.
address
,
initialSupply
,
{
from
:
initialHolder
});
const
{
tx
}
=
await
this
.
token
.
recover
(
anotherAccount
);
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
await
expectEvent
.
inTransaction
(
tx
,
this
.
token
,
'Transfer'
,
{
from
:
ZERO_ADDRESS
,
to
:
anotherAccount
,
value
:
initialSupply
,
...
...
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