defi-wonderland / smock

The Solidity mocking library
MIT License
319 stars 40 forks source link

Allow mock/fake.resetAll() #129

Open wei3erHase opened 2 years ago

wei3erHase commented 2 years ago

How it works now:

fake.someFunction.returns(1,2,3)
fake.someOtherFunction.returns([3,2])
...
// and then at some other context
fake.someFunction.reset()
fake.someOtherFunction.reset()

This requires the developer to remember to reset all of the set variables and brings unexpected error when forgets to reset a previous return. How it should work:

fake.someFunction.returns(1,2,3)
fake.someOtherFunction.returns([3,2])
...
fake.resetAll()