コード例 #1
0
ファイル: EthModule.cs プロジェクト: angelinai/nethermind
        private ResultWrapper <Quantity> GetAccountBalance(Address address, BlockParameter blockParameter)
        {
            if (blockParameter.Type == BlockParameterType.Pending)
            {
                var balance = _blockchainBridge.GetBalance(address);
                return(ResultWrapper <Quantity> .Success(new Quantity(balance)));
            }

            var block = GetBlock(blockParameter);

            if (block.Result.ResultType == ResultType.Failure)
            {
                return(ResultWrapper <Quantity> .Fail(block.Result.Error));
            }
            return(GetAccountBalance(address, block.Data.Header.StateRoot));
        }
コード例 #2
0
ファイル: EthModule.cs プロジェクト: chidionyema/nethermind
        private ResultWrapper <BigInteger?> GetAccountBalance(Address address, BlockParameter blockParameter)
        {
            if (blockParameter.Type == BlockParameterType.Pending)
            {
                var balance = _blockchainBridge.GetBalance(address);
                return(ResultWrapper <BigInteger?> .Success(balance));
            }

            var block = GetBlock(blockParameter);

            if (block.Result.ResultType == ResultType.Failure)
            {
                return(ResultWrapper <BigInteger?> .Fail(block.Result.Error, ErrorType.InternalError, null));
            }

            return(GetAccountBalance(address, block.Data.Header.StateRoot));
        }