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
* feat: throw error in getTransactionByHash
Signed-off-by: Ivo Yankov <[email protected]>
* feat: add env var for dev mode
Signed-off-by: Ivo Yankov <[email protected]>
* test: add unit tests for reverted tx in getTransactionByHash
Signed-off-by: Ivo Yankov <[email protected]>
* test: add acceptance tests for dev mode
Signed-off-by: Ivo Yankov <[email protected]>
* docs: add docs for dev_mode
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
`Developer mode` is intended to be used by users when developing and testing smart contracts. It allows `hardhat-chai-matchers` and other similar libraries to correctly assert revert messages of non-pure contract methods.
4
+
It will also be expanded with special settings to speed up the [local node](https://github.com/hashgraph/hedera-local-node).
5
+
6
+
## Enabling
7
+
8
+
To enable `dev mode` start the Relay with the environment variable `DEV_MODE` set to `true`.
9
+
10
+
11
+
## Rationale
12
+
13
+
In the example below `contract.call()` will make the following requests to the JSON RPC Relay: `eth_chainId, eth_estimateGas, eth_sendRawTransaction, eth_getTransactionByHash`
The asserting method expects to catch an error from any of the called API endpoints. Normally `eth_estimateGas` throws the error if the contract call is about to revert,
20
+
but that is currently not possible in the context of Hedera. Instead the error can be thrown by `eth_getTransactionByHash` after the transaction has gone through the consensus nodes.
21
+
Since that is not the normal desired behaviour it is only enabled in this mode.
0 commit comments