File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ module.exports = {
88 gas : config . gas ,
99 gasPrice : config . gasPrice ,
1010 norpc : true ,
11- testCommand : 'npx truffle test ./test/unit/**/* .js' ,
11+ testCommand : 'npx truffle test ./test/unit/*.js' ,
1212 compileCommand : 'npx truffle compile' ,
1313 skipFiles : [ 'mocks' ] ,
1414 copyPackages : [ 'openzeppelin-zos' ] ,
Original file line number Diff line number Diff line change 11pragma solidity 0.4.24 ;
22
3+
34contract Mock {
45 event FunctionCalled (string functionName , address caller );
56 event FunctionArguments (uint256 [] uintVals , int256 [] intVals );
Original file line number Diff line number Diff line change @@ -2,19 +2,11 @@ pragma solidity 0.4.24;
22
33import "./Mock.sol " ;
44
5+
56contract MockMarketOracle is Mock {
67 uint128 private exchangeRate;
78 uint128 private volume;
89
9- // Methods to mock data on the chain
10- function storeRate (uint128 _exchangeRate ) public {
11- exchangeRate = _exchangeRate;
12- }
13-
14- function storeVolume (uint128 _volume ) public {
15- volume = _volume;
16- }
17-
1810 // Mock methods
1911 function getPriceAndVolume () external returns (uint128 , uint128 ) {
2012 emit FunctionCalled ("MarketOracle:getPriceAndVolume " , msg .sender );
@@ -23,4 +15,13 @@ contract MockMarketOracle is Mock {
2315 emit FunctionArguments (uintVals, intVals);
2416 return (exchangeRate, volume);
2517 }
18+
19+ // Methods to mock data on the chain
20+ function storeRate (uint128 _exchangeRate ) public {
21+ exchangeRate = _exchangeRate;
22+ }
23+
24+ function storeVolume (uint128 _volume ) public {
25+ volume = _volume;
26+ }
2627}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ pragma solidity 0.4.24;
22
33import "./Mock.sol " ;
44
5+
56contract MockUFragments is Mock {
67 uint256 private supply;
78
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ pragma solidity 0.4.24;
33import "./Mock.sol " ;
44import "../lib/SafeMathInt.sol " ;
55
6+
67contract SafeMathIntMock is Mock {
78 function mul (int256 _a , int256 _b ) external {
89 emit ReturnValueInt256 (SafeMathInt.mul (_a, _b));
@@ -22,5 +23,5 @@ contract SafeMathIntMock is Mock {
2223
2324 function toUint256Safe (int256 _a ) external returns (uint256 ) {
2425 return SafeMathInt.toUint256Safe (_a);
25- }
26+ }
2627}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ run-unit-tests(){
1313 npx truffle \
1414 --network $1 \
1515 test \
16- $PROJECT_DIR /test/unit/** / * .js
16+ $PROJECT_DIR /test/unit/* .js
1717}
1818
1919run-simulation-tests (){
You can’t perform that action at this time.
0 commit comments