xyz.stratalab.indexer.services.TxoValidator.scala Maven / Gradle / Ivy
The newest version!
package xyz.stratalab.indexer.services
object TxoValidator extends scalapb.validate.Validator[xyz.stratalab.indexer.services.Txo] {
def validate(input: xyz.stratalab.indexer.services.Txo): scalapb.validate.Result =
xyz.stratalab.sdk.models.transaction.UnspentTransactionOutputValidator.validate(input.transactionOutput) &&
xyz.stratalab.sdk.models.TransactionOutputAddressValidator.validate(input.outputAddress) &&
scalapb.validate.Result.optional(input.spender) { _value =>
xyz.stratalab.indexer.services.TxoValidator.SpenderValidator.validate(_value)
}
object SpenderValidator extends scalapb.validate.Validator[xyz.stratalab.indexer.services.Txo.Spender] {
def validate(input: xyz.stratalab.indexer.services.Txo.Spender): scalapb.validate.Result =
xyz.stratalab.sdk.models.TransactionInputAddressValidator.validate(input.inputAddress) &&
xyz.stratalab.sdk.models.transaction.SpentTransactionOutputValidator.validate(input.input)
}
}