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

com.wavesplatform.transaction.validation.impl.CreateAliasTxValidator.scala Maven / Gradle / Ivy

The newest version!
package com.wavesplatform.transaction.validation.impl

import cats.data.Validated
import com.wavesplatform.account.Alias
import com.wavesplatform.transaction.CreateAliasTransaction
import com.wavesplatform.transaction.validation.{TxValidator, ValidatedV}

object CreateAliasTxValidator extends TxValidator[CreateAliasTransaction] {
  override def validate(tx: CreateAliasTransaction): ValidatedV[CreateAliasTransaction] = {
    import tx.*
    V.seq(tx)(
      Validated.fromEither(Alias.createWithChainId(aliasName, chainId, Some(chainId))).toValidatedNel.map((_: Alias) => tx)
    )
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy