Closed Wodann closed 1 year ago
smock stores a reference to ethereumjs' vm by accessing it through the Hardhat API. It uses this API to:
"beforeMessage"
and "afterMessage"
evm eventsputContractCode
, getContractStorage
, and putContractStorage
With Rethnet, we are currently only outputting complete traces at the end of a transaction. This should however be sufficient for the use case of smock
, as its already always piping all received before- and after-messages.
To allow community modules mutable access to the state, we could expose an interface inspired by ethereumjs-statemanager's interface StateAccess
. This interface should ensure that modifications are not only applied to the state but the diff is also logged in the undo/redo stack.
With Rethnet, we are currently only outputting complete traces at the end of a transaction. This should however be sufficient for the use case of
smock
, as its already always piping all received before- and after-messages.
Agree.
To allow community modules mutable access to the state, we could expose an interface inspired by ethereumjs-statemanager's
interface StateAccess
. This interface should ensure that modifications are not only applied to the state but the diff is also logged in the undo/redo stack.
A simpler option might be to just ask them to go through the JSON-RPC layer for these things.
As I understand, this would require changes in smock
?
Additional question: do we have tests for smock
integration?
As I understand, this would require changes in
smock
?
Not necessarily. We could have a fake object that simulates the same behavior we have now but that uses the new components under the hood.
Additional question: do we have tests for
smock
integration?
Same answer as in https://github.com/NomicFoundation/edr/issues/44#issuecomment-1737321778
Definition of Done Ensure that Hardhat with EDR works with
smock