use of org.hyperledger.besu.evm.tracing.EstimateGasOperationTracer in project besu by hyperledger.
the class EthEstimateGas method response.
@Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
final JsonCallParameter callParams = validateAndGetCallParams(requestContext);
final BlockHeader blockHeader = blockHeader();
if (blockHeader == null) {
return errorResponse(requestContext, JsonRpcError.INTERNAL_ERROR);
}
if (!blockchainQueries.getWorldStateArchive().isWorldStateAvailable(blockHeader.getStateRoot(), blockHeader.getHash())) {
return errorResponse(requestContext, JsonRpcError.WORLD_STATE_UNAVAILABLE);
}
final CallParameter modifiedCallParams = overrideGasLimitAndPrice(callParams, blockHeader.getGasLimit());
final EstimateGasOperationTracer operationTracer = new EstimateGasOperationTracer();
return transactionSimulator.process(modifiedCallParams, ImmutableTransactionValidationParams.builder().from(TransactionValidationParams.transactionSimulator()).isAllowExceedingBalance(!callParams.isMaybeStrict().orElse(Boolean.FALSE)).build(), operationTracer, blockHeader.getNumber()).map(gasEstimateResponse(requestContext, operationTracer)).orElse(errorResponse(requestContext, JsonRpcError.INTERNAL_ERROR));
}
use of org.hyperledger.besu.evm.tracing.EstimateGasOperationTracer in project besu by hyperledger.
the class EstimateGasOperationTracerTest method setUp.
@Before
public void setUp() {
operationTracer = new EstimateGasOperationTracer();
messageFrameTestFixture = new MessageFrameTestFixture();
}
Aggregations