isValidPairingTopic method

  1. @override
Future<void> isValidPairingTopic({
  1. required String topic,
})
override

Implementation

@override
Future<void> isValidPairingTopic({required String topic}) async {
  if (!pairings.has(topic)) {
    throw Errors.getInternalError(
      Errors.NO_MATCHING_KEY,
      context: "pairing topic doesn't exist: $topic",
    );
  }

  if (await core.expirer.checkAndExpire(topic)) {
    throw Errors.getInternalError(
      Errors.EXPIRED,
      context: 'pairing topic: $topic',
    );
  }
}