You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a few contracts in my protocol. Two of them are token contracts that have a shared interface and some unique functions. The shared functions have different implementations but the logic for testing them is the same. Because of this, I set up tests that can be ran for both tokens.
Unfortunately, I ran into an odd FixtureSnapshotError even though I am not using any beforeEach or nested fixtures.
That's because the deployed contracts differ from the ones returned by the fixture set up function. What you could do instead is to move the call to the loadFixture to your helper functions.
So your baseTokenFixture would become something like:
async function loadBaseTokenFixture(whichOne: 'ONE' | 'TWO') {
const fixture = await loadFixture(deployFixture); // Note the call to load fixture here
...
And then your shared test could just await that instead:
Version of Hardhat
2.22.5
What happened?
Hey, thanks for looking over my issue.
I have a few contracts in my protocol. Two of them are token contracts that have a shared interface and some unique functions. The shared functions have different implementations but the logic for testing them is the same. Because of this, I set up tests that can be ran for both tokens.
Unfortunately, I ran into an odd
FixtureSnapshotError
even though I am not using anybeforeEach
or nested fixtures.Minimal reproduction steps
https://github.com/petdomaa100/hardhat-fixture-error-minimal-reproducible-example
Search terms
fixture, FixtureSnapshotError
The text was updated successfully, but these errors were encountered: