Skip to content

Commit

Permalink
Merge pull request #825 from wavesplatform/disable-mass-payment
Browse files Browse the repository at this point in the history
MassPayment and its tests were disabled
  • Loading branch information
alexeykiselev authored Feb 7, 2018
2 parents 3855781 + 188da32 commit 0b4da9e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ object BlockchainFeatures {
val NG = BlockchainFeature(2)
val MassTransfer = BlockchainFeature(3)

val implemented: Set[Short] = Set(SmallerMinimalGeneratingBalance, NG, MassTransfer).map(_.id)
//TODO: MassTransfer: add MassTransfer to implemented to actvate
val implemented: Set[Short] = Set(SmallerMinimalGeneratingBalance, NG).map(_.id)

}
29 changes: 15 additions & 14 deletions src/test/scala/com/wavesplatform/UtxPoolSpecification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.wavesplatform
import java.util.concurrent.locks.ReentrantReadWriteLock

import com.typesafe.config.ConfigFactory
import com.wavesplatform.features.BlockchainFeatures
import com.wavesplatform.history.{HistoryWriterImpl, StorageFactory}
import com.wavesplatform.settings.{BlockchainSettings, FeeSettings, FeesSettings, FunctionalitySettings, UtxSettings, WavesSettings}
import com.wavesplatform.state2.diffs._
Expand Down Expand Up @@ -43,7 +42,8 @@ class UtxPoolSpecification extends FreeSpec
val genesisSettings = TestHelpers.genesisSettings(Map(senderAccount -> senderBalance))
val settings = WavesSettings.fromConfig(config).copy(
blockchainSettings = BlockchainSettings('T', 5, 5,
FunctionalitySettings.TESTNET.copy(preActivatedFeatures = Map(BlockchainFeatures.MassTransfer.id -> 0)),
FunctionalitySettings.TESTNET,
// TODO: MassTransfer: use this line and delete former then activated FunctionalitySettings.TESTNET.copy(preActivatedFeatures = Map(BlockchainFeatures.MassTransfer.id -> 0)),
genesisSettings))

val db = open()
Expand Down Expand Up @@ -141,17 +141,17 @@ class UtxPoolSpecification extends FreeSpec
}).label("withBlacklistedAndAllowedByRule")

private def massTransferWithBlacklisted(allowRecipients: Boolean) = (for {
(sender, senderBalance, state, history, featureProvider) <- stateGen
addressGen = Gen.listOf(accountGen).filter(list => if (allowRecipients) list.nonEmpty else true)
recipients <- addressGen
time = new TestTime()
txs <- Gen.nonEmptyListOf(massTransferWithRecipients(sender, recipients, senderBalance / 10, time))
} yield {
val whitelist: Set[String] = if (allowRecipients) recipients.map(_.address).toSet else Set.empty
val settings = UtxSettings(txs.length, 1.minute, Set(sender.address), whitelist, 5.minutes)
val utxPool = new UtxPoolImpl(time, state, history, featureProvider, calculator, FunctionalitySettings.TESTNET, settings)
(sender, utxPool, txs)
}).label("massTransferWithBlacklisted")
(sender, senderBalance, state, history, featureProvider) <- stateGen
addressGen = Gen.listOf(accountGen).filter(list => if (allowRecipients) list.nonEmpty else true)
recipients <- addressGen
time = new TestTime()
txs <- Gen.nonEmptyListOf(massTransferWithRecipients(sender, recipients, senderBalance / 10, time))
} yield {
val whitelist: Set[String] = if (allowRecipients) recipients.map(_.address).toSet else Set.empty
val settings = UtxSettings(txs.length, 1.minute, Set(sender.address), whitelist, 5.minutes)
val utxPool = new UtxPoolImpl(time, state, history, featureProvider, calculator, FunctionalitySettings.TESTNET, settings)
(sender, utxPool, txs)
}).label("massTransferWithBlacklisted")

private def utxTest(utxSettings: UtxSettings = UtxSettings(20, 5.seconds, Set.empty, Set.empty, 5.minutes), txCount: Int = 10)
(f: (Seq[TransferTransaction], UtxPool, TestTime) => Unit): Unit = forAll(
Expand Down Expand Up @@ -291,7 +291,8 @@ class UtxPoolSpecification extends FreeSpec
}
}

"allow a transfer transaction from blacklisted address to specific addresses" in {
//TODO: MassTransfer: remove ignore then activated
"allow a transfer transaction from blacklisted address to specific addresses" ignore {
val transferGen = Gen.oneOf(withBlacklistedAndAllowedByRule, massTransferWithBlacklisted(allowRecipients = true))
forAll(transferGen) { case (_, utxPool, txs) =>
all(txs.map { t =>
Expand Down

0 comments on commit 0b4da9e

Please sign in to comment.