Skip to content

Commit

Permalink
Merge pull request #527 from ScorexFoundation/i526
Browse files Browse the repository at this point in the history
More diversity of scripts in generators
  • Loading branch information
catena2w authored Jun 12, 2019
2 parents 981efcb + e1e2bae commit cb095c7
Show file tree
Hide file tree
Showing 16 changed files with 651 additions and 634 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import sigmastate.basics.DLogProtocol
import sigmastate.basics.DLogProtocol.DLogProverInput
import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer
import sigmastate.serialization.ValueSerializer
import sigmastate.serialization.generators.ValueGenerators
import sigmastate.serialization.generators.ObjectGenerators
import org.ergoplatform.ErgoScriptPredef._
import org.ergoplatform.validation.ValidationSpecification
import sigmastate.Values.ErgoTree

class ErgoAddressSpecification extends PropSpec
with ValueGenerators
with ObjectGenerators
with PropertyChecks
with Matchers
with TryValues
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/org/ergoplatform/ErgoLikeTransactionSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import sigmastate.Values.ByteArrayConstant
import sigmastate.helpers.SigmaTestingCommons
import sigmastate.interpreter.{ContextExtension, ProverResult}
import sigmastate.serialization.SigmaSerializer
import sigmastate.serialization.generators.ValueGenerators
import sigmastate.serialization.generators.ObjectGenerators
import sigmastate.eval._
import sigmastate.eval.Extensions._
import sigmastate.SType._

class ErgoLikeTransactionSpec extends PropSpec
with GeneratorDrivenPropertyChecks
with Matchers
with ValueGenerators
with ObjectGenerators
with SigmaTestingCommons {

property("ErgoLikeTransaction: Serializer round trip") {
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/sigmastate/lang/SigmaCompilerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import sigmastate.interpreter.Interpreter.ScriptEnv
import sigmastate.lang.Terms.{Lambda, MethodCall, ZKProofBlock, Apply, Ident}
import sigmastate.lang.exceptions.{CosterException, InvalidArguments, TyperException}
import sigmastate.serialization.ValueSerializer
import sigmastate.serialization.generators.ValueGenerators
import sigmastate.serialization.generators.ObjectGenerators
import sigmastate.utxo.{GetVar, ExtractAmount, ByIndex, SelectField}
import sigmastate.eval._

class SigmaCompilerTest extends SigmaTestingCommons with LangTests with ValueGenerators {
class SigmaCompilerTest extends SigmaTestingCommons with LangTests with ObjectGenerators {
import CheckingSigmaBuilder._
implicit lazy val IR: TestingIRContext = new TestingIRContext {
beginPass(noConstPropagationPass)
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/sigmastate/lang/SigmaSpecializerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import sigmastate._
import sigmastate.lang.SigmaPredef.PredefinedFuncRegistry
import sigmastate.lang.Terms.{Ident, ZKProofBlock}
import sigmastate.lang.exceptions.SpecializerException
import sigmastate.serialization.generators.{ConcreteCollectionGenerators, TransformerGenerators, ValueGenerators}
import sigmastate.serialization.generators.{ConcreteCollectionGenerators, TransformerGenerators, ObjectGenerators}
import sigmastate.utxo._
import sigmastate.lang.Terms._

class SigmaSpecializerTest extends PropSpec
with PropertyChecks
with Matchers
with LangTests
with ValueGenerators
with ObjectGenerators
with ConcreteCollectionGenerators
with TransformerGenerators {

Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/sigmastate/lang/SigmaTyperTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import sigmastate.interpreter.Interpreter.ScriptEnv
import sigmastate.lang.SigmaPredef._
import sigmastate.lang.Terms.Select
import sigmastate.lang.exceptions.TyperException
import sigmastate.serialization.generators.ValueGenerators
import sigmastate.serialization.generators.ObjectGenerators
import sigmastate.utxo.{ExtractCreationInfo, Append}

class SigmaTyperTest extends PropSpec with PropertyChecks with Matchers with LangTests with ValueGenerators {
class SigmaTyperTest extends PropSpec with PropertyChecks with Matchers with LangTests with ObjectGenerators {

private val predefFuncRegistry = new PredefinedFuncRegistry(StdSigmaBuilder)
import predefFuncRegistry._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait SerializationSpecification extends PropSpec
with GeneratorDrivenPropertyChecks
with TableDrivenPropertyChecks
with Matchers
with ValueGenerators
with ObjectGenerators
with ConcreteCollectionGenerators
with OpcodesGen
with TransformerGenerators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import sigmastate._
import sigmastate.basics.DLogProtocol.ProveDlog
import sigmastate.basics.ProveDHTuple
import sigmastate.helpers.{ContextEnrichingTestProvingInterpreter, SigmaTestingCommons}
import sigmastate.serialization.generators.ValueGenerators
import sigmastate.serialization.generators.ObjectGenerators
import sigmastate.utxo.Transformer

import scala.util.Random

class SigSerializerSpecification extends SigmaTestingCommons with ValueGenerators {
class SigSerializerSpecification extends SigmaTestingCommons with ObjectGenerators {
implicit lazy val IR = new TestingIRContext
private lazy implicit val arbExprGen: Arbitrary[SigmaBoolean] = Arbitrary(exprTreeGen)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.scalacheck.{Arbitrary, Gen}
import sigmastate._
import sigmastate.Values.{ConcreteCollection, EvaluatedValue, Value}

trait ConcreteCollectionGenerators { self: ValueGenerators =>
trait ConcreteCollectionGenerators { self: ObjectGenerators =>
val minCollLength = 1
val maxCollLength = 10

Expand Down
Loading

0 comments on commit cb095c7

Please sign in to comment.