makerdao / dss-test

GNU Affero General Public License v3.0
11 stars 9 forks source link

Adding xdomain support #11

Closed hexonaut closed 2 years ago

hexonaut commented 2 years ago

I think it makes sense to start building in multichain support by default for testing.

hexonaut commented 2 years ago

This is ready for review with support for xchain integration testing Arbitrum and Optimism. Please update to most recent Foundry as a lot of bugs have been fixed while I was building this.

hexonaut commented 2 years ago

So there is a fairly major refactor here. I've consolidated all the previously hardcoded address values into a config format that keys based on what the chain id is. RPC endpoints are no longer defined in the foundry.toml. It also made sense to move the chainlog address in here too.

This will allow multiple instances of ArbitrumDomain (ex. one pointing to Arbitrum One and one to Arbitrum Nova), and allow us to easily switch between Mainnet and Goerli tests.

I've also added convenience methods to the Domain to fetch domain-specific config variables, and each Domain has an MCD instance now.

It is a bit of a breaking change for DssTest.setupEnv(), but I felt the previous setup was starting to crack. There are only 2-3 repos using this atm, so I think it makes sense to break things now.

I think this is cleaner personally. Let me know what you guys think.

hexonaut commented 2 years ago

Btw if you want more examples of how this is used: https://github.com/makerdao/xdomain/tree/add-optimism/packages/dss-bridge/src/tests/domains