isValidRequiredNamespaces function

ErrorObject? isValidRequiredNamespaces(
  1. ProposalRequiredNamespaces? input,
  2. String method
)

Implementation

ErrorObject? isValidRequiredNamespaces(
  ProposalRequiredNamespaces? input,
  String method,
) {
  ErrorObject? error;
  if (input?.isNotEmpty ?? false) {
    final validActionsError = isValidNamespaceActions(input!, method);
    if (validActionsError != null) {
      error = validActionsError;
    }
    final validChainsError = isValidNamespaceChains(input, method);
    if (validChainsError != null) {
      error = validChainsError;
    }
  } else {
    error = getInternalError(
      InternalErrorKey.MISSING_OR_INVALID,
      context: '$method, requiredNamespaces should be an object with data',
    );
  }

  return error;
}