mirror of https://github.com/hyperledger/besu
Add revert reason to eth_estimateGas RPC call error (#1730)
Add revert reason to eth_estimateGas RPC call error Signed-off-by: Vladyslav Lupashevskyi <vlad@lupashevskyi.com>pull/1737/head
parent
98383c5777
commit
0905d1b233
@ -0,0 +1,48 @@ |
||||
/* |
||||
* Copyright ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.ethereum.api.jsonrpc; |
||||
|
||||
import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil; |
||||
|
||||
import java.net.URL; |
||||
|
||||
import org.junit.runner.RunWith; |
||||
import org.junit.runners.Parameterized; |
||||
import org.junit.runners.Parameterized.Parameters; |
||||
|
||||
@RunWith(Parameterized.class) |
||||
public class EthByzantiumJsonRpcHttpBySpecTest extends AbstractJsonRpcHttpBySpecTest { |
||||
|
||||
public EthByzantiumJsonRpcHttpBySpecTest(final String specName, final URL specURL) { |
||||
super(specName, specURL); |
||||
} |
||||
|
||||
@Override |
||||
public void setup() throws Exception { |
||||
super.setup(); |
||||
startService(); |
||||
} |
||||
|
||||
@Override |
||||
protected BlockchainSetupUtil getBlockchainSetupUtil() { |
||||
return createBlockchainSetupUtil( |
||||
"trace/chain-data/genesis.json", "trace/chain-data/blocks.bin"); |
||||
} |
||||
|
||||
@Parameters(name = "{index}: {0}") |
||||
public static Object[][] specs() { |
||||
return AbstractJsonRpcHttpBySpecTest.findSpecFiles("eth_latest"); |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
{ |
||||
"request": { |
||||
"id": 3, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_estimateGas", |
||||
"params": [ |
||||
{ |
||||
"from": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"data": "0x600160005560016000fe6011600155" |
||||
} |
||||
] |
||||
}, |
||||
"response": { |
||||
"jsonrpc": "2.0", |
||||
"id": 3, |
||||
"error": { |
||||
"code": -32603, |
||||
"message": "Internal error" |
||||
} |
||||
}, |
||||
"statusCode": 200 |
||||
} |
@ -0,0 +1,23 @@ |
||||
{ |
||||
"request": { |
||||
"id": 3, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_estimateGas", |
||||
"params": [ |
||||
{ |
||||
"from": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"data": "0x600160005560016000fd6011600155" |
||||
} |
||||
] |
||||
}, |
||||
"response": { |
||||
"jsonrpc": "2.0", |
||||
"id": 3, |
||||
"error": { |
||||
"code": -32000, |
||||
"message": "Execution reverted", |
||||
"data": "0x00" |
||||
} |
||||
}, |
||||
"statusCode": 200 |
||||
} |
Loading…
Reference in new issue