defi-wonderland / smock

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

Attach an impersonated wallet to fakes/mocks #49

Closed smartcontracts closed 3 years ago

smartcontracts commented 3 years ago

Is your feature request related to a problem? Please describe. Smock v1 has a feature where an impersonated wallet gets attached to every fake/mock, which allows you to send transactions from a contract address. Here's the code for that: https://github.com/ethereum-optimism/optimism/blob/09372ad920061b59cb4f19e1b13f782bc54011c6/packages/smock/src/smockit/smockit.ts#L175-L182.

Describe the solution you'd like I'd like to have this feature added to Smock v2 since it was in Smock v1.

0xGorilla commented 3 years ago

Actually there is already, same API as smock v1, just do myFake.wallet in order to sign transactions.

Could you please add some docs and a test?