public ResultWrapper <UInt256?> eth_estimateGas(TransactionForRpc transactionCall) { BlockHeader head = _blockchainBridge.FindLatestHeader(); FixCallTx(transactionCall, head); long result = _blockchainBridge.EstimateGas(head, transactionCall.ToTransaction()); return(ResultWrapper <UInt256?> .Success((UInt256)result)); }
public ResultWrapper <UInt256?> eth_estimateGas(TransactionForRpc transactionCall) { BlockHeader head = _blockchainBridge.FindLatestHeader(); FixCallTx(transactionCall, head); BlockchainBridge.CallOutput result = _blockchainBridge.EstimateGas(head, transactionCall.ToTransaction()); if (result.Error == null) { return(ResultWrapper <UInt256?> .Success((UInt256)result.GasSpent)); } return(ResultWrapper <UInt256?> .Fail(result.Error)); }
public ResultWrapper <UInt256?> eth_estimateGas(TransactionForRpc transactionCall) { BlockHeader head = _blockchainBridge.FindLatestHeader(); if (!HasStateForBlock(head)) { return(ResultWrapper <UInt256?> .Fail($"No state available for block {head.Hash}", ErrorCodes.ResourceUnavailable)); } FixCallTx(transactionCall, head); BlockchainBridge.CallOutput result = _blockchainBridge.EstimateGas(head, transactionCall.ToTransaction()); if (result.Error == null) { return(ResultWrapper <UInt256?> .Success((UInt256)result.GasSpent)); } return(ResultWrapper <UInt256?> .Fail(result.Error)); }