public async Task get_latest_block_number_should_invoke_proxy_eth_blockNumber_and_return_number_if_result_is_valid()
        {
            long number = 1;

            _proxy.eth_blockNumber().Returns(RpcResult <long?> .Ok(number));
            var result = await _ndmBridge.GetLatestBlockNumberAsync();

            await _proxy.Received().eth_blockNumber();

            result.Should().Be(number);
        }
Пример #2
0
        public async Task eth_blockNumber_should_invoke_client_method()
        {
            await _proxy.eth_blockNumber();

            await _client.Received().SendAsync <long?>(nameof(_proxy.eth_blockNumber));
        }
        public async Task <long> GetLatestBlockNumberAsync()
        {
            var result = await _proxy.eth_blockNumber();

            return(result?.IsValid == true && result.Result.HasValue ? result.Result.Value : 0);
        }
Пример #4
0
 public async Task <ResultWrapper <long?> > eth_blockNumber()
 => ResultWrapper <long?> .From(await _proxy.eth_blockNumber());