-
Notifications
You must be signed in to change notification settings - Fork 695
evm_mine
method fails to return a result
field
#354
Comments
@benjamincburns - we are hitting this as well (also worked around in the project i submitted for #293). we can work around it if necessary but shouldn't it return a list of the transactions it mines? |
I don't see why. This command is to order the miner to start. The response should be "ok started". |
@xavierlepretre - I believe the command is to mine a single block upon command. miner_stop & miner_start stop and re-start mining. evn_mine should mine a block and return receipts for the transactions it mines, methinks. Am I off base? |
This is a pretty quick one to fix - great first time contribution for anyone who wants to submit a PR. |
@yarrumretep |
Sorry, I should've clarified earlier that I think this is out of scope for |
OK - I think I'm clear on what you are saying @xavierlepretre - evm_mine only requests the miner to mine one block according to whatever settings it has (instamine, or periodic). Its up to the client to independently listen for that block to mine. Makes sense. In this case it should just return empty result so web3 extend call doesn't fail. I was thrown off by this discussion: trufflesuite/ganache#108 in which it seemed to me that evm_mine was synchronous by design (i.e. mined a block and returned the results). |
In looking at the code on ganache-core@develop, it appears that evm_mine indeed mines one block immediately (regardless of if the auto-mining setting is periodic). It then returns errors (including runtime errors) from the transactions mined. I'll submit a PR that changes evm_mine to return true with the errors (if any). This is parallel to the miner_start function. Sound right? |
…ure valid JSON_RPC response.
Yes, that's the expected/intended behaviour.
I believe most rpc calls which have no real return value just set the |
Fixed in current |
A valid JSON RPC response must contain the
result:
field. When you callevm_mine
, theresult
field is missing.Expected Behavior
The
evm_mine
call should return aresult
field, even if empty.Current Behavior
As of now, no
result
field is sent back.Possible Solution
Steps to Reproduce (for bugs)
If you want to see how this becomes a problem, try to declare:
Then, when you call
web3.evm.mine(myCallback)
, you get the error:Context
I am declaring methods for the
evm_
calls.Your Environment
The text was updated successfully, but these errors were encountered: