public async Task <ResultWrapper <DepositDetailsForRpc> > ndm_getDeposit(Keccak depositId)
        {
            var deposit = await _consumerService.GetDepositAsync(depositId);

            return(deposit == null
                ? ResultWrapper <DepositDetailsForRpc> .Fail($"Deposit: '{depositId}' was not found.")
                : ResultWrapper <DepositDetailsForRpc> .Success(new DepositDetailsForRpc(deposit)));
        }
        public async Task <ResultWrapper <DepositDetailsForRpc> > ndm_getDeposit(Keccak depositId)
        {
            uint           timestamp = (uint)_timestamper.UnixTime.Seconds;
            DepositDetails?deposit   = await _consumerService.GetDepositAsync(depositId);

            return(deposit is null
                ? ResultWrapper <DepositDetailsForRpc> .Fail($"Deposit: '{depositId}' was not found.")
                : ResultWrapper <DepositDetailsForRpc> .Success(new DepositDetailsForRpc(deposit, timestamp)));
        }
Beispiel #3
0
        public async Task get_deposit_should_return_deposit()
        {
            var depositId = TestItem.KeccakA;

            _consumerService.GetDepositAsync(depositId).Returns(GetDepositDetails());
            var result = await _rpc.ndm_getDeposit(depositId);

            await _consumerService.Received().GetDepositAsync(depositId);

            result.Result.ResultType.Should().Be(ResultType.Success);
            result.ErrorType.Should().Be(ErrorType.None);
            result.Result.Error.Should().BeNullOrWhiteSpace();
            VerifyDepositDetails(result.Data);
        }