<commit_before>package com.wavesplatform.it.sync.transactions

import com.wavesplatform.it.api.SyncHttpApi._
import com.wavesplatform.it.transactions.BaseTransactionSuite
import com.wavesplatform.it.util._
import org.scalatest.prop.TableDrivenPropertyChecks
import scala.util.Random



class AliasTransactionSuite extends BaseTransactionSuite with TableDrivenPropertyChecks {

  private val transferFee = 1.waves
  private val leasingFee = 0.001.waves
  private val transferAmount = 1.waves

  test("Able to send money to an alias") {
    val alias = "test_alias"
    val (balance1, eff1) = notMiner.accountBalances(firstAddress)

    val aliasFee = calcAliasFee(firstAddress, alias)
    notMiner.assertBalances(firstAddress, balance1 - aliasFee, eff1 - aliasFee)

    val aliasFull = fullAliasByAddress(firstAddress, alias)

    val transferId = sender.transfer(firstAddress
        , aliasFull
        , transferAmount
        , transferFee).id

    nodes.waitForHeightAraiseAndTxPresent(transferId)
    notMiner.assertBalances(firstAddress
        , balance1 - transferFee - aliasFee
        , eff1 - transferFee - aliasFee)
  }

  test("Not able to create same aliases to same address") {
    val alias = randomAlias()
    val (balance1, eff1) = notMiner.accountBalances(firstAddress)
    val aliasFee = calcAliasFee(firstAddress, alias)
    notMiner.assertBalances(firstAddress, balance1 - aliasFee, eff1 - aliasFee)

    assertBadRequest2(sender.createAlias(firstAddress, alias, transferFee))
    notMiner.assertBalances(firstAddress, balance1 - aliasFee, eff1 - aliasFee)
  }

  test("Not able to create aliases to other addresses") {
    val alias = randomAlias()
<commit_msg>Update AliasTransactionSuite.scala<commit_after>package com.wavesplatform.it.sync.transactions

import com.wavesplatform.it.api.SyncHttpApi._
import com.wavesplatform.it.transactions.BaseTransactionSuite
import com.wavesplatform.it.util._
import org.scalatest.prop.TableDrivenPropertyChecks
import scala.util.Random


class AliasTransactionSuite extends BaseTransactionSuite with TableDrivenPropertyChecks {

  private val transferFee = 1.waves
  private val leasingFee = 0.001.waves
  private val transferAmount = 1.waves

  test("Able to send money to an alias") {
    val alias = randomAlias()
    val (balance1, eff1) = notMiner.accountBalances(firstAddress)

    val aliasFee = calcAliasFee(firstAddress, alias)
    notMiner.assertBalances(firstAddress, balance1 - aliasFee, eff1 - aliasFee)

    val aliasFull = fullAliasByAddress(firstAddress, alias)

    val transferId = sender.transfer(firstAddress
        , aliasFull
        , transferAmount
        , transferFee).id

    nodes.waitForHeightAraiseAndTxPresent(transferId)
    notMiner.assertBalances(firstAddress
        , balance1 - transferFee - aliasFee
        , eff1 - transferFee - aliasFee)
  }

  test("Not able to create same aliases to same address") {
    val alias = randomAlias()
    val (balance1, eff1) = notMiner.accountBalances(firstAddress)
    val aliasFee = calcAliasFee(firstAddress, alias)
    notMiner.assertBalances(firstAddress, balance1 - aliasFee, eff1 - aliasFee)

    assertBadRequest2(sender.createAlias(firstAddress, alias, transferFee))
    notMiner.assertBalances(firstAddress, balance1 - aliasFee, eff1 - aliasFee)
  }

  test("Not able to create aliases to other addresses") {
    val alias = randomAlias()

{'fraction_non_alphanumeric': 0.07878430215402774, 'fraction_numerical': 0.011212747123045146, 'mean_word_length': 4.231481481481482, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2147853', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1006, 'n_words': 231}