public async Task try_confirm_should_skip_further_processing_if_transaction_is_pending() { var deposit = GetDepositDetails(); var transaction = GetTransaction(true); _blockchainBridge.GetTransactionAsync(deposit.Transaction.Hash).Returns(transaction); await _depositConfirmationService.TryConfirmAsync(deposit); await _blockchainBridge.Received().GetTransactionAsync(deposit.Transaction.Hash); await _depositService.DidNotReceive().VerifyDepositAsync(deposit.Consumer, deposit.Id, Arg.Any <long>()); }
public async Task try_confirm_should_skip_further_processing_if_block_was_not_found() { const int latestBlockNumber = 3; var deposit = GetDepositDetails(); var transaction = GetTransaction(); _blockchainBridge.GetTransactionAsync(deposit.TransactionHash).Returns(transaction); _blockchainBridge.GetLatestBlockNumberAsync().Returns(latestBlockNumber); await _depositConfirmationService.TryConfirmAsync(deposit); await _blockchainBridge.Received().GetLatestBlockNumberAsync(); await _blockchainBridge.Received().FindBlockAsync(latestBlockNumber); await _depositService.DidNotReceive().VerifyDepositAsync(deposit.Consumer, deposit.Id, Arg.Any <long>()); }