Example #1
0
        public ResultWrapper <UInt256?> eth_estimateGas(TransactionForRpc transactionCall)
        {
            Block headBlock = _blockchainBridge.FindHeadBlock();

            if (transactionCall.Gas == null)
            {
                transactionCall.Gas = headBlock.GasLimit;
            }

            long result = _blockchainBridge.EstimateGas(headBlock, transactionCall.ToTransaction());

            return(ResultWrapper <UInt256?> .Success((UInt256)result));
        }
Example #2
0
        public ResultWrapper <BigInteger?> eth_estimateGas(TransactionForRpc transactionCall)
        {
            try
            {
                _readerWriterLockSlim.EnterWriteLock();
                Block headBlock = _blockchainBridge.FindHeadBlock();
                if (transactionCall.Gas == null)
                {
                    transactionCall.Gas = headBlock.GasLimit;
                }

                long result = _blockchainBridge.EstimateGas(headBlock, transactionCall.ToTransaction());
                return(ResultWrapper <BigInteger?> .Success(result));
            }
            finally
            {
                _readerWriterLockSlim.ExitWriteLock();
            }
        }