ethermint icon indicating copy to clipboard operation
ethermint copied to clipboard

RPC eth_sendTransaction does not work as expected when based on input parameter rather than data parameter

Open banishee opened this issue 4 years ago • 1 comments

System info: [Include Ethermint commit, operating system name, and other relevant details]

  • branch dev

Steps to reproduce:

  1. Use eth_SendTransaction api to deploy a contract, and fill out the input parameter
  2. Then try to query the receipt, it will shows that the status is 0x0

Expected behavior: [What you expected to happen]

  • the status of an evm transaction is suppsed to be 0x1, whether it takes input or data as a parameter

Actual behavior: [What actually happened]

  • the status of an evm transaction will be 0x0when it takes input as a parameter

Additional info: [Include gist of relevant config, logs, etc.]

  • Here is a piece of test code:
        param := make([]map[string]string, 1)
	param[0] = make(map[string]string)
	param[0]["from"] = hexAddr1.Hex()
        // set contract payload in "input", not "data"
	param[0]["input"] = "0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029"
	param[0]["gasPrice"] = (*hexutil.Big)(defaultGasPrice.Amount.BigInt()).String()
	rpcRes := Call(t, "eth_sendTransaction", param)

	var hash hexutil.Bytes
	require.NoError(t, json.Unmarshal(rpcRes.Result, &hash))
        // try to query the receipt based on hash
	receipt := WaitForReceipt(t, hash)
	require.NotNil(t, receipt)
	require.Equal(t, "0x1", receipt["status"].(string))
``

banishee avatar Feb 17 '21 08:02 banishee

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 04 '21 00:04 github-actions[bot]