eth_sendTransaction returns internal trace on missing param (#1284)

* added test, used get method for from param

* gosec fixes

* adding nosec v1

* added test to python tests, removed testing lines

* fixing flake issues

* test-unit-cover

* changelog fix

* changelog 2

* fix gomod2nix

* integration tests

Co-authored-by: Freddy Caceres <facs95@gmail.com>
This commit is contained in:
Adi Saravanan
2022-08-25 13:22:31 +02:00
committed by GitHub
co-authored by Freddy Caceres
parent f9c74e239c
commit 1ea0cb31b7
5 changed files with 31 additions and 2 deletions
+18
View File
@@ -329,6 +329,24 @@ func waitForReceipt(t *testing.T, hash hexutil.Bytes) map[string]interface{} {
}
}
func TestEth_IncompleteSendTransaction(t *testing.T) {
// get gasprice
gasPrice := GetGasPrice(t)
// make tx params without from address
param := make([]map[string]string, 1)
param[0] = make(map[string]string)
param[0]["from"] = ""
param[0]["to"] = "0x1122334455667788990011223344556677889900"
param[0]["value"] = "0x1"
param[0]["gasPrice"] = gasPrice
_, err := callWithError("eth_sendTransaction", param)
// require well-formatted error (should not be "method handler crashed")
require.Error(t, err)
require.NotEqual(t, err.Error(), "method handler crashed", "no from field dealt with incorrectly")
}
func TestEth_GetFilterChanges_NoTopics(t *testing.T) {
rpcRes := call(t, "eth_blockNumber", []string{})