示例#1
0
        public async Task eth_getBalance_should_invoke_client_method()
        {
            var address = TestItem.AddressA;
            await _proxy.eth_getBalance(address);

            await _client.Received().SendAsync <UInt256?>(nameof(_proxy.eth_getBalance),
                                                          address, null);
        }
示例#2
0
        private async Task <decimal?> GetBalanceAsync()
        {
            var result = await _ethJsonRpcClientProxy.eth_getBalance(_address);

            if (!result.IsValid || !result.Result.HasValue)
            {
                return(null);
            }

            return(decimal.Parse(result.Result.ToString()).WeiToEth());
        }
示例#3
0
        private async Task UpdateBalanceAsync()
        {
            if (_balanceLabel is null)
            {
                return;
            }
            var balanceResult = await _ethJsonRpcClientProxy.eth_getBalance(_address);

            _balanceEth = WeiToEth(decimal.Parse(balanceResult.Result.ToString()));
            _transferWindow.Remove(_balanceLabel);
            _balanceLabel = new Label(65, 1, $"Balance: {_balanceEth} ETH");

            _transferWindow.Add(_balanceLabel);
        }
示例#4
0
 public async Task <ResultWrapper <UInt256?> > eth_getBalance(Address address, BlockParameter blockParameter)
 => ResultWrapper <UInt256?> .From(await _proxy.eth_getBalance(address, MapBlockParameter(blockParameter)));