Badger Finance
Search…
Adding a new Strategy

Testing Core Functionality & Access Control

When testing strategies, snapshots are taken of state before and after operation and results are compared to expectations. This happens via a SnapshotManager and Resolver class. Resolvers are strategy-specific helper class that defines what properties to track in snapshots, and how to verify the results of actions (deposit, withdraw, earn, harvest, tend) in terms of how values within the system are expected to change
See more about snapshots and resolvers here.
In addition, strategies are unit tested using fresh, minimal deployments of the relevant components. This allows them to be tested in isolation and speeds up run time by deploying less contracts. This process is managed via helpers classes called MiniDeploys. These define the minimum setup for a strategy. All classes extend from the MiniDeployBase contract.
Last modified 6mo ago
Copy link