com.wavesplatform.transaction.validation.impl.IssueTxValidator.scala Maven / Gradle / Ivy
The newest version!
package com.wavesplatform.transaction.validation.impl
import com.wavesplatform.lang.script.v1.ExprScript
import com.wavesplatform.transaction.TxValidationError.GenericError
import com.wavesplatform.transaction.assets.IssueTransaction
import com.wavesplatform.transaction.validation.{TxValidator, ValidatedV}
import com.wavesplatform.transaction.TxVersion
object IssueTxValidator extends TxValidator[IssueTransaction] {
override def validate(tx: IssueTransaction): ValidatedV[IssueTransaction] = {
import tx._
V.seq(tx)(
V.assetName(tx.name),
V.assetDescription(tx.description),
V.cond(version > TxVersion.V1 || script.isEmpty, GenericError("Script not supported")),
V.cond(script.forall(_.isInstanceOf[ExprScript]), GenericError(s"Asset can only be assigned with Expression script, not Contract"))
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy