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
c7f2138d
Unverified
Commit
c7f2138d
authored
Jan 17, 2018
by
Facundo Spagnuolo
Committed by
GitHub
Jan 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #688 from AugustoL/refactor/reorganize-tests
Reorganize tests and add library folder
parents
b0522b9c
b67856c6
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
29 additions
and
30 deletions
+29
-30
TokenDestructible.sol
contracts/lifecycle/TokenDestructible.sol
+1
-1
DetailedERC20Mock.sol
contracts/mocks/DetailedERC20Mock.sol
+1
-1
ERC827TokenMock.sol
contracts/mocks/ERC827TokenMock.sol
+1
-1
SafeERC20Helper.sol
contracts/mocks/SafeERC20Helper.sol
+2
-2
CanReclaimToken.sol
contracts/ownership/CanReclaimToken.sol
+2
-2
BasicToken.sol
contracts/token/BasicToken.sol
+1
-1
DetailedERC20.sol
contracts/token/ERC20/DetailedERC20.sol
+0
-0
ERC20.sol
contracts/token/ERC20/ERC20.sol
+0
-0
ERC20Basic.sol
contracts/token/ERC20/ERC20Basic.sol
+0
-0
SafeERC20.sol
contracts/token/ERC20/SafeERC20.sol
+0
-0
ERC827.sol
contracts/token/ERC827/ERC827.sol
+1
-1
ERC827Token.sol
contracts/token/ERC827/ERC827Token.sol
+1
-1
StandardToken.sol
contracts/token/StandardToken.sol
+1
-1
TokenTimelock.sol
contracts/token/TokenTimelock.sol
+1
-2
TokenVesting.sol
contracts/token/TokenVesting.sol
+2
-2
SimpleToken.test.js
test/examples/SimpleToken.test.js
+3
-3
ECRecovery.test.js
test/library/ECRecovery.test.js
+3
-3
Math.test.js
test/library/Math.test.js
+1
-1
MerkleProof.test.js
test/library/MerkleProof.test.js
+2
-2
DetailedERC20.test.js
test/token/ERC20/DetailedERC20.test.js
+1
-1
SafeERC20.test.js
test/token/ERC20/SafeERC20.test.js
+2
-2
ERC827Token.js
test/token/ERC827/ERC827Token.js
+3
-3
No files found.
contracts/lifecycle/TokenDestructible.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "../ownership/Ownable.sol";
import "../ownership/Ownable.sol";
import "../token/ERC20Basic.sol";
import "../token/ERC20
/ERC20
Basic.sol";
/**
/**
...
...
contracts/mocks/DetailedERC20Mock.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "../token/StandardToken.sol";
import "../token/StandardToken.sol";
import "../token/DetailedERC20.sol";
import "../token/
ERC20/
DetailedERC20.sol";
contract DetailedERC20Mock is StandardToken, DetailedERC20 {
contract DetailedERC20Mock is StandardToken, DetailedERC20 {
...
...
contracts/mocks/ERC827TokenMock.sol
View file @
c7f2138d
pragma solidity ^0.4.13;
pragma solidity ^0.4.13;
import "../token/ERC827Token.sol";
import "../token/ERC827
/ERC827
Token.sol";
// mock class using ERC827 Token
// mock class using ERC827 Token
...
...
contracts/mocks/SafeERC20Helper.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "../token/ERC20.sol";
import "../token/ERC20
/ERC20
.sol";
import "../token/SafeERC20.sol";
import "../token/
ERC20/
SafeERC20.sol";
contract ERC20FailingMock is ERC20 {
contract ERC20FailingMock is ERC20 {
...
...
contracts/ownership/CanReclaimToken.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "./Ownable.sol";
import "./Ownable.sol";
import "../token/ERC20Basic.sol";
import "../token/ERC20
/ERC20
Basic.sol";
import "../token/SafeERC20.sol";
import "../token/
ERC20/
SafeERC20.sol";
/**
/**
...
...
contracts/token/BasicToken.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "./ERC20Basic.sol";
import "./ERC20
/ERC20
Basic.sol";
import "../math/SafeMath.sol";
import "../math/SafeMath.sol";
...
...
contracts/token/DetailedERC20.sol
→
contracts/token/
ERC20/
DetailedERC20.sol
View file @
c7f2138d
File moved
contracts/token/ERC20.sol
→
contracts/token/ERC20
/ERC20
.sol
View file @
c7f2138d
File moved
contracts/token/ERC20Basic.sol
→
contracts/token/ERC20
/ERC20
Basic.sol
View file @
c7f2138d
File moved
contracts/token/SafeERC20.sol
→
contracts/token/
ERC20/
SafeERC20.sol
View file @
c7f2138d
File moved
contracts/token/ERC827.sol
→
contracts/token/ERC827
/ERC827
.sol
View file @
c7f2138d
pragma solidity ^0.4.13;
pragma solidity ^0.4.13;
import "./ERC20.sol";
import ".
./ERC20
/ERC20.sol";
/**
/**
...
...
contracts/token/ERC827Token.sol
→
contracts/token/ERC827
/ERC827
Token.sol
View file @
c7f2138d
pragma solidity ^0.4.13;
pragma solidity ^0.4.13;
import "./ERC827.sol";
import "./ERC827.sol";
import "./StandardToken.sol";
import ".
.
/StandardToken.sol";
/**
/**
@title ERC827, an extension of ERC20 token standard
@title ERC827, an extension of ERC20 token standard
...
...
contracts/token/StandardToken.sol
View file @
c7f2138d
...
@@ -2,7 +2,7 @@ pragma solidity ^0.4.18;
...
@@ -2,7 +2,7 @@ pragma solidity ^0.4.18;
import "./BasicToken.sol";
import "./BasicToken.sol";
import "./ERC20.sol";
import "./ERC20
/ERC20
.sol";
/**
/**
...
...
contracts/token/TokenTimelock.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "./ERC20Basic.sol";
import "./ERC20/SafeERC20.sol";
import "../token/SafeERC20.sol";
/**
/**
...
...
contracts/token/TokenVesting.sol
View file @
c7f2138d
pragma solidity ^0.4.18;
pragma solidity ^0.4.18;
import "./ERC20Basic.sol";
import "./ERC20
/ERC20
Basic.sol";
import "./SafeERC20.sol";
import "./
ERC20/
SafeERC20.sol";
import "../ownership/Ownable.sol";
import "../ownership/Ownable.sol";
import "../math/SafeMath.sol";
import "../math/SafeMath.sol";
...
...
test/SimpleToken.test.js
→
test/
examples/
SimpleToken.test.js
View file @
c7f2138d
import
decodeLogs
from
'./helpers/decodeLogs'
;
import
decodeLogs
from
'.
.
/helpers/decodeLogs'
;
const
SimpleToken
=
artifacts
.
require
(
'
examples/
SimpleToken.sol'
);
const
SimpleToken
=
artifacts
.
require
(
'SimpleToken.sol'
);
contract
(
'SimpleToken'
,
accounts
=>
{
contract
(
'SimpleToken'
,
accounts
=>
{
let
token
;
let
token
;
...
@@ -23,7 +23,7 @@ contract('SimpleToken', accounts => {
...
@@ -23,7 +23,7 @@ contract('SimpleToken', accounts => {
const
decimals
=
await
token
.
decimals
();
const
decimals
=
await
token
.
decimals
();
assert
(
decimals
.
eq
(
18
));
assert
(
decimals
.
eq
(
18
));
});
});
it
(
'assigns the initial total supply to the creator'
,
async
function
()
{
it
(
'assigns the initial total supply to the creator'
,
async
function
()
{
const
totalSupply
=
await
token
.
totalSupply
();
const
totalSupply
=
await
token
.
totalSupply
();
const
creatorBalance
=
await
token
.
balanceOf
(
creator
);
const
creatorBalance
=
await
token
.
balanceOf
(
creator
);
...
...
test/ECRecovery.test.js
→
test/
library/
ECRecovery.test.js
View file @
c7f2138d
var
ECRecoveryMock
=
artifacts
.
require
(
'
../contracts/mocks/
ECRecoveryMock.sol'
);
var
ECRecoveryMock
=
artifacts
.
require
(
'ECRecoveryMock.sol'
);
var
ECRecoveryLib
=
artifacts
.
require
(
'
../contracts/
ECRecovery.sol'
);
var
ECRecoveryLib
=
artifacts
.
require
(
'ECRecovery.sol'
);
var
hashMessage
=
require
(
'./helpers/hashMessage.js'
);
var
hashMessage
=
require
(
'.
.
/helpers/hashMessage.js'
);
contract
(
'ECRecovery'
,
function
(
accounts
)
{
contract
(
'ECRecovery'
,
function
(
accounts
)
{
let
ecrecovery
;
let
ecrecovery
;
...
...
test/Math.test.js
→
test/
library/
Math.test.js
View file @
c7f2138d
var
MathMock
=
artifacts
.
require
(
'./mocks/MathMock.sol'
);
var
MathMock
=
artifacts
.
require
(
'.
.
/mocks/MathMock.sol'
);
contract
(
'Math'
,
function
(
accounts
)
{
contract
(
'Math'
,
function
(
accounts
)
{
let
math
;
let
math
;
...
...
test/MerkleProof.test.js
→
test/
library/
MerkleProof.test.js
View file @
c7f2138d
import
MerkleTree
from
'./helpers/merkleTree.js'
;
import
MerkleTree
from
'.
.
/helpers/merkleTree.js'
;
import
{
sha3
,
bufferToHex
}
from
'ethereumjs-util'
;
import
{
sha3
,
bufferToHex
}
from
'ethereumjs-util'
;
var
MerkleProof
=
artifacts
.
require
(
'
./
MerkleProof.sol'
);
var
MerkleProof
=
artifacts
.
require
(
'MerkleProof.sol'
);
contract
(
'MerkleProof'
,
function
(
accounts
)
{
contract
(
'MerkleProof'
,
function
(
accounts
)
{
let
merkleProof
;
let
merkleProof
;
...
...
test/token/DetailedERC20.test.js
→
test/token/
ERC20/
DetailedERC20.test.js
View file @
c7f2138d
...
@@ -5,7 +5,7 @@ require('chai')
...
@@ -5,7 +5,7 @@ require('chai')
.
use
(
require
(
'chai-bignumber'
)(
BigNumber
))
.
use
(
require
(
'chai-bignumber'
)(
BigNumber
))
.
should
();
.
should
();
const
DetailedERC20Mock
=
artifacts
.
require
(
'
mocks/
DetailedERC20Mock.sol'
);
const
DetailedERC20Mock
=
artifacts
.
require
(
'DetailedERC20Mock.sol'
);
contract
(
'DetailedERC20'
,
accounts
=>
{
contract
(
'DetailedERC20'
,
accounts
=>
{
let
detailedERC20
=
null
;
let
detailedERC20
=
null
;
...
...
test/token/SafeERC20.test.js
→
test/token/
ERC20/
SafeERC20.test.js
View file @
c7f2138d
import
EVMThrow
from
'../helpers/EVMThrow'
;
import
EVMThrow
from
'../
../
helpers/EVMThrow'
;
require
(
'chai'
)
require
(
'chai'
)
.
use
(
require
(
'chai-as-promised'
))
.
use
(
require
(
'chai-as-promised'
))
.
should
();
.
should
();
const
SafeERC20Helper
=
artifacts
.
require
(
'
mocks/
SafeERC20Helper.sol'
);
const
SafeERC20Helper
=
artifacts
.
require
(
'SafeERC20Helper.sol'
);
contract
(
'SafeERC20'
,
function
()
{
contract
(
'SafeERC20'
,
function
()
{
beforeEach
(
async
function
()
{
beforeEach
(
async
function
()
{
...
...
test/ERC827Token.js
→
test/
token/ERC827/
ERC827Token.js
View file @
c7f2138d
import
EVMRevert
from
'./helpers/EVMRevert'
;
import
EVMRevert
from
'.
./..
/helpers/EVMRevert'
;
var
Message
=
artifacts
.
require
(
'
./mock/
MessageHelper.sol'
);
var
Message
=
artifacts
.
require
(
'MessageHelper.sol'
);
var
ERC827TokenMock
=
artifacts
.
require
(
'
./mock/
ERC827TokenMock.sol'
);
var
ERC827TokenMock
=
artifacts
.
require
(
'ERC827TokenMock.sol'
);
var
BigNumber
=
web3
.
BigNumber
;
var
BigNumber
=
web3
.
BigNumber
;
var
_
=
require
(
'lodash'
);
var
_
=
require
(
'lodash'
);
...
...
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