nomad-xyz / monorepo

Nomad Monorepo -- SDKs, Contracts, and more!
https://www.nomad.xyz
Apache License 2.0
118 stars 28 forks source link

Feat: CoreForkBase #538

Closed odyslam closed 1 year ago

odyslam commented 1 year ago

This is a draft PR, and it doesn't compile.

Before investing a bunch of time in refactoring, this is a blueprint of how I imagine the test suite to be modular:

Let's start from the ground up:

With this design, we have the following contract inheritance:|

I have added Mock because it's helpful to test some system parts in isolation. For example, Bridge tests might be Local (LocalBridge) for the bridge contracts but MockCore for the Core contracts.

Before diving into refactoring NomadBase to be able to properly inherit ReplicaTest to a ForkReplicaTest, I want to ask for some feedback. I spent some time thinking about how I should go about this, and this approach seems the sanest -- assuming we want modularity between the systems (fork, local, etc.) and not build them in isolation.

For the actual inheritance, I imagine all the test contracts to be abstract and then have:

anna-carroll commented 1 year ago

I think we will refactor to something along these lines very soon, esp once foundry race condition for fork testing is solid. For now, closing the PR as i believe it was mostly meant to be illustrative