Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating to buidler #492

Merged
merged 105 commits into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
18ef61b
First start of migration to buidler
jjgonecrypto Apr 2, 2020
db992f2
Introducing unit tests
jjgonecrypto Apr 2, 2020
799ab46
trigger build
jjgonecrypto Apr 2, 2020
0a96f7f
trigger build v2
jjgonecrypto Apr 2, 2020
e36dda3
Fixing circleci config
jjgonecrypto Apr 2, 2020
72f7c2f
Fixing tests for Buidler
jjgonecrypto Apr 2, 2020
3245577
Migrating delegate approvals to unit
jjgonecrypto Apr 3, 2020
2060de8
SystemStatus to unit
jjgonecrypto Apr 3, 2020
c0d8111
Migrating ProxyERC20 to unit
jjgonecrypto Apr 3, 2020
8952e77
Adding fallback test to ProxyERC20
jjgonecrypto Apr 3, 2020
13af456
MixinResolver to unit tests
jjgonecrypto Apr 3, 2020
a84ab3c
SupplySchedule a WIP
jjgonecrypto Apr 3, 2020
6f4e487
Renaming common test setup
jjgonecrypto Apr 3, 2020
58e1a96
Minor updates
jjgonecrypto Apr 3, 2020
9a6d903
Fixing coverage
jjgonecrypto Apr 4, 2020
1d901df
Adding back timestamp tests
jjgonecrypto Apr 5, 2020
7d5c336
Upgrading to use timestamp from latest buidler
jjgonecrypto Apr 6, 2020
0baaca2
Merge branch 'develop' into migrating-to-buidler
jjgonecrypto Apr 6, 2020
4213109
SynthetixState
jjgonecrypto Apr 6, 2020
55453a3
Adding more checks to SupplySchedule
jjgonecrypto Apr 6, 2020
71d032e
Better approach to setup
jjgonecrypto Apr 6, 2020
97c3897
Refactoring ExchangeRates to use setup script
jjgonecrypto Apr 6, 2020
75970c2
Adding ABI check to ExchangeRates
jjgonecrypto Apr 6, 2020
908a3e1
Upgrading to solidity-coverage@0.7.3
jjgonecrypto Apr 6, 2020
31ab8a3
Removing unneeded settings
jjgonecrypto Apr 6, 2020
7ef10a2
Removing unneeded settings
jjgonecrypto Apr 6, 2020
2dde295
Revert "Removing unneeded settings"
jjgonecrypto Apr 6, 2020
40e1b4b
Fixing coverage
jjgonecrypto Apr 6, 2020
25c26a2
Fixing coverage tests to use starting timestamp
jjgonecrypto Apr 6, 2020
c14f992
New setup script WIP
jjgonecrypto Apr 7, 2020
ff96c8a
Better setup
jjgonecrypto Apr 7, 2020
9a19c32
Adding supply
jjgonecrypto Apr 7, 2020
3121fdb
Mock token functionality
jjgonecrypto Apr 7, 2020
617ddcd
Allowing for mocks as address resolver deps
jjgonecrypto Apr 7, 2020
48a0e1e
Depot test fixes
jjgonecrypto Apr 7, 2020
437f9fc
Fixing Depot tests with gas
jjgonecrypto Apr 7, 2020
31952c5
Adding MockSynth for Depot and EtherCollateral
jjgonecrypto Apr 7, 2020
651c7de
Test improvements for EtherCollateral
jjgonecrypto Apr 7, 2020
70e8682
Fixing most of EtherCollateral
jjgonecrypto Apr 7, 2020
afe504a
Merge branch 'develop' into migrating-to-buidler
jjgonecrypto Apr 7, 2020
75a55f4
Adding timeout for specifc long-running test
jjgonecrypto Apr 7, 2020
16f34dd
Update to using new unit coverage
jjgonecrypto Apr 7, 2020
d839c76
Merge branch 'develop' into migrating-to-buidler
jjgonecrypto Apr 7, 2020
30b04d0
Fixing tests
jjgonecrypto Apr 7, 2020
d68facb
Fixing legacy tests
jjgonecrypto Apr 7, 2020
aff92e9
Minor fixes
jjgonecrypto Apr 7, 2020
8ba7403
Fixing remaining EtherCollateral test
jjgonecrypto Apr 7, 2020
5005345
Adding more SynthetixState tests
jjgonecrypto Apr 7, 2020
a7a6788
Merge branch 'develop' into migrating-to-buidler
jjgonecrypto Apr 8, 2020
8cc103a
RewardEscrow migrated over
jjgonecrypto Apr 9, 2020
485de38
Fixing EtherCollateral
jjgonecrypto Apr 9, 2020
59524a2
Fixing coverage to use PR
jjgonecrypto Apr 9, 2020
84f9d84
Adding larger specific timeouts for coverage
jjgonecrypto Apr 9, 2020
361f1c9
Fixing timeouts for coverage
jjgonecrypto Apr 9, 2020
6fa1888
Synthetix WIP
jjgonecrypto Apr 9, 2020
4c24861
Synthetix more structure
jjgonecrypto Apr 10, 2020
d2e0889
Working through Synthetix tests
jjgonecrypto Apr 10, 2020
53cf526
Working thru Synthetix still, now with Issuer
jjgonecrypto Apr 10, 2020
200e1b4
More progress with Synthetix - now with generic mocks
jjgonecrypto Apr 10, 2020
8110123
Supporting exchange() in Synthetix tests
jjgonecrypto Apr 10, 2020
afb7563
fixing synthetix.mint()
jjgonecrypto Apr 11, 2020
4b22422
Fixing remainder of Synthetix tests
jjgonecrypto Apr 11, 2020
6da3d13
Fixing broken tests, der
jjgonecrypto Apr 11, 2020
d1845a7
Fixing EtherCollateral
jjgonecrypto Apr 11, 2020
75b9ba6
FeePoolState
jjgonecrypto Apr 11, 2020
316fdd0
Simpler implementation
jjgonecrypto Apr 11, 2020
cb13e1d
Exchanger WIP
jjgonecrypto Apr 13, 2020
454f379
Exchanger WIP
jjgonecrypto Apr 13, 2020
24d6142
Fixing Exchanger
jjgonecrypto Apr 13, 2020
dd3092e
Trimming up RewardEscrow to be a unit test
jjgonecrypto Apr 13, 2020
127cd99
Merge branch 'develop' into migrating-to-buidler
jjgonecrypto Apr 13, 2020
c433f9c
Adding Synth test
jjgonecrypto Apr 14, 2020
dc2d940
Adding more coverage to Synth test
jjgonecrypto Apr 14, 2020
5bb00e1
Fixing Issuer tests
jjgonecrypto Apr 15, 2020
b2280dc
Fixing tests
jjgonecrypto Apr 15, 2020
46f631a
Upgrading to solidity-coverage@0.7.4
jjgonecrypto Apr 15, 2020
0b75b2e
Depot Test Coverage
Apr 15, 2020
0164ebd
updateRatesWithDefaults moved
Apr 15, 2020
db8c3a9
Merge branch 'migrating-to-buidler' of github.com:Synthetixio/synthet…
Apr 15, 2020
40cad9e
Fixing Depot test
jjgonecrypto Apr 15, 2020
2d41fd2
Fixing RewardsDistribution
jjgonecrypto Apr 15, 2020
9744b1c
Porting over MultiCollateralSynth
jjgonecrypto Apr 15, 2020
cd453cf
Migrating FeePool tests
jjgonecrypto Apr 15, 2020
1119750
Fixing usages of getDecodedLogs
jjgonecrypto Apr 15, 2020
fb803fa
Purgeable Synth porting over
jjgonecrypto Apr 15, 2020
3ce6cbc
Final test :bow:
jjgonecrypto Apr 15, 2020
4f97c3d
Removing truffle migrations
jjgonecrypto Apr 15, 2020
d63cf9b
The death of truffle :skull_and_crossbones:
jjgonecrypto Apr 15, 2020
cc4be4e
Fixing circleci yml
jjgonecrypto Apr 15, 2020
0da43ed
The removal of ganache :boom:
jjgonecrypto Apr 15, 2020
04bd544
Updating lock
jjgonecrypto Apr 15, 2020
e808cd5
Cleaning up invocation
jjgonecrypto Apr 15, 2020
086eea4
Commenting out test failure from coverage
jjgonecrypto Apr 15, 2020
e7cdadc
The last vestigates of truffle...
jjgonecrypto Apr 15, 2020
9f19ce4
Moving test files back to test/contracts
jjgonecrypto Apr 15, 2020
3da8719
Cleaning up test helpers
jjgonecrypto Apr 16, 2020
e10c938
set default min stake time (#498)
jacko125 Apr 16, 2020
c296100
PR feedback
jjgonecrypto Apr 16, 2020
c103910
Merge branch 'migrating-to-buidler' of github.com:Synthetixio/synthet…
jjgonecrypto Apr 16, 2020
71e6e22
Removing contract and web3 globals
jjgonecrypto Apr 16, 2020
f1cbdb8
Adding chai for assertions and explicit usage of all globals
jjgonecrypto Apr 16, 2020
100c0c7
Cleaning up util usage and test setup
jjgonecrypto Apr 16, 2020
b54d60f
Ensuring web3 is properly wrapped into testUtils
jjgonecrypto Apr 16, 2020
7ea3aab
Fixing local testnet test
jjgonecrypto Apr 16, 2020
0ceafab
Cleanup
jjgonecrypto Apr 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
- 'v2-dependencies-{{ checksum "package-lock.json" }}'
- v2-dependencies-
- run: npm install
- run: npx truffle compile
- save_cache:
paths:
- node_modules
Expand All @@ -44,7 +43,6 @@ jobs:
# add compiled contracts to persisted workspace
# (note not currently working due to:
# https://github.com/trufflesuite/truffle/issues/2239#issuecomment-552041859)
- build

lint:
<<: *env_defaults
Expand All @@ -54,6 +52,15 @@ jobs:
at: .
- run: npm run lint

test-unit:
<<: *env_defaults
steps:
- checkout
- attach_workspace:
at: .
- run: npx @nomiclabs/buidler compile
- run: npm run test:unit

test-contracts:
<<: *env_defaults
parallelism: 4
Expand Down Expand Up @@ -160,6 +167,9 @@ workflows:
- lint:
requires:
- prepare
- test-unit:
requires:
- prepare
- test-contracts:
requires:
- prepare
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ language: node_js
node_js:
- 10.16.3
env:
- UNIT=1
- COVERAGE=1
- GAS=1
script:
- if [ "$UNIT" = "1" ]; then npm run test:unit; fi
- if [ "$COVERAGE" = "1" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash); fi
- if [ "$GAS" = "1" ]; then npm ci && npm test && npx codechecks; fi
24 changes: 24 additions & 0 deletions buidler.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { usePlugin } = require('@nomiclabs/buidler/config');

usePlugin('@nomiclabs/buidler-truffle5');
usePlugin('solidity-coverage');

module.exports = {
solc: {
version: '0.4.25',
},
paths: {
sources: './contracts',
tests: './test/unit',
artifacts: './build/artifacts',
cache: './build/cache',
},
networks: {
coverage: {
initialDate: '2019-03-06T00:00:00',
url: 'http://localhost:8545',
blockGasLimit: 0x1fffffffffffff,
Copy link
Contributor

@cgewecke cgewecke Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinjmoses solidity-coverage doesn't work with buidlerevm yet. I think here you should add another network..like

coverage: {
  url: 'http://localhost:8545
}

... and then run buidler coverage --network coverage as the command.

Copy link
Contributor

@cgewecke cgewecke Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT - your .solcover.js specifies port 8545, changing the network url above to reflect that:

port: 8545,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much Chris! That fixes it. 🙏

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for giving support for your Buidler plugin, Chris 🙌

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinjmoses Is the coverage difference here (e.g a drop) expected or does it seem like something's not right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codecov is using the truffle coverage which has dropped as I've migrated tests to buidler, so you can ignore it. I checked out running npm run coverage:unit and the results are looking good. Once I move the rest of the tests over to unit from contracts, I'll update travis to use buidler coverage which will update codecov.

allowUnlimitedContractSize: true,
},
},
};
7 changes: 7 additions & 0 deletions contracts/test-helpers/PublicEST.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ contract PublicEST is ExternStateToken {
function transferFrom(address from, address to, uint value) external optionalProxy returns (bool) {
return _transferFrom_byProxy(messageSender, from, to, value);
}

// Index all parameters to make them easier to find in raw logs (as this will be emitted via a proxy and not decoded)
event Received(address indexed sender, uint256 indexed inputA, bytes32 indexed inputB);

function somethingToBeProxied(uint256 inputA, bytes32 inputB) external {
emit Received(messageSender, inputA, inputB);
}
}
Loading