code: def wait_for_transfer_success(
          raiden: 'RaidenService',
          payment_identifier: PaymentID,
          amount: PaymentAmount,
          retry_timeout: float,
  ) -> None:
      
      found = False
      while not found:
          state_events = raiden.wal.storage.get_events()
          for event in state_events:
              found = (
                  isinstance(event, EventPaymentReceivedSuccess) and
                  event.identifier == payment_identifier and
                  event.amount == amount
              )
              if found:
                  break
  
          gevent.sleep(retry_timeout)
docs: Wait until a transfer with a specific identifier and amount
      is seen in the WAL.
  
      Note:
          This does not time out, use gevent.Timeout.