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
Typical development evm's such as hardhat's local node, truffle's ganache local blockchain or foundry's revm all implement functionality to override and manipulate evm state for the purposes of local debugging and testing which are typically exposed via json rpc methods(though foundry doesn't appear to do so, however, exposes such functionality via the Vm interface).
The list of these methods supported by these different development frameworks can be found here:
It's possible that methods may have different names across these frameworks but the functionality is identical, so to maximise compatibility for projects new or existing that are written in a particular framework all methods can be exposed by the hedera developer json rpc that would map to the same handler/controller e.g. hardhat_mine and evm_mineBlockNumber do the same thing but in different ways, i.e. they both advance the evm to a certain block number, but hardhat_mine requires you to specify by how many blocks from the current block, whereas evm_mineBlockNumber requires you to specify the exact block to mine.
Some of the most useful methods for local testing are:
evm_snapshot & evm_revert
evm_increaseTime
evm_setTime
evm_freezeTime
evm_mine
evm_mineBlockNumber
miner_start
miner_stop
evm_setAutomine
evm_setIntervalMining
evm_setNextBlockTimestamp
evm_setAccountBalance
Additionally, hardhat's console.log is useful for debugging.
A method specific to Hedera would be evm_setNativePrice which set's the USD price for HBAR which can be retrieved via the IExchangeRate interface.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Typical development evm's such as hardhat's local node, truffle's ganache local blockchain or foundry's revm all implement functionality to override and manipulate evm state for the purposes of local debugging and testing which are typically exposed via json rpc methods(though foundry doesn't appear to do so, however, exposes such functionality via the Vm interface).
The list of these methods supported by these different development frameworks can be found here:
It's possible that methods may have different names across these frameworks but the functionality is identical, so to maximise compatibility for projects new or existing that are written in a particular framework all methods can be exposed by the hedera developer json rpc that would map to the same handler/controller e.g.
hardhat_mine
andevm_mineBlockNumber
do the same thing but in different ways, i.e. they both advance the evm to a certain block number, buthardhat_mine
requires you to specify by how many blocks from the current block, whereasevm_mineBlockNumber
requires you to specify the exact block to mine.Some of the most useful methods for local testing are:
Additionally, hardhat's console.log is useful for debugging.
A method specific to Hedera would be
evm_setNativePrice
which set's the USD price for HBAR which can be retrieved via theIExchangeRate
interface.Beta Was this translation helpful? Give feedback.
All reactions