All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.stratalab.sdk.models.box.ChallengeValidator.scala Maven / Gradle / Ivy

The newest version!
package xyz.stratalab.sdk.models.box

object ChallengeValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.box.Challenge] {
  def validate(input: xyz.stratalab.sdk.models.box.Challenge): scalapb.validate.Result =
    scalapb.validate.Result.optional(input.proposition.revealed) { _value =>
      quivr.models.PropositionValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.proposition.previous) { _value =>
      xyz.stratalab.sdk.models.box.ChallengeValidator.PreviousPropositionValidator.validate(_value)
    }
  
  object PreviousPropositionValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.box.Challenge.PreviousProposition] {
    def validate(input: xyz.stratalab.sdk.models.box.Challenge.PreviousProposition): scalapb.validate.Result =
      scalapb.validate.Result.optional(input.address) { _value =>
        xyz.stratalab.sdk.models.TransactionInputAddressValidator.validate(_value)
      }
    
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy