validateContext function

void validateContext(
  1. Context context
)

Implementation

void validateContext(Context context) {
  if (context.contextAddress.isEmpty) {
    logger.info(
        'Context validation failed: Provided context address in context is not valid');
    throw invalidParamError(
        'The provided context address in context is not valid');
  }

  if (context.contextMessage.isEmpty) {
    logger.info(
        'Context validation failed: Provided context message in context is not valid');
    throw invalidParamError(
        'The provided context message in context is not valid');
  }

  validateFunctionParams([
    ParamValidation(
        input: context.contextAddress,
        paramName: 'contextAddress',
        isString: true),
    ParamValidation(
        input: context.contextMessage,
        paramName: 'contextMessage',
        isString: true)
  ], 'validateContext');
}