Skip to content

Commit

Permalink
fix checkmethod rule test
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Jan 10, 2025
1 parent 15a3096 commit 8aa8002
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sigmastate
import org.ergoplatform._
import org.ergoplatform.validation.ValidationRules._
import org.scalatest.BeforeAndAfterAll
import sigma.{Colls, SigmaTestingData}
import sigma.{Colls, SigmaTestingData, VersionContext}
import sigma.ast._
import sigma.ast.SPrimType.MaxPrimTypeCode
import sigma.ast.TypeCodes.LastConstantCode
Expand Down Expand Up @@ -340,12 +340,14 @@ class SoftForkabilitySpecification extends SigmaTestingData
}

property("CheckMethod rule") {
val freeMethodId = 16.toByte
val mcBytes = Array[Byte](OpCodes.PropertyCallCode, SCollection.typeId, freeMethodId, Outputs.opCode)
val v2vs = vs.updated(CheckAndGetMethod.id, ChangedRule(Array(SCollection.typeId, freeMethodId)))
checkRule(CheckAndGetMethod, v2vs, {
ValueSerializer.deserialize(mcBytes)
})
VersionContext.withVersions(3,0) {
val freeMethodId = 16.toByte
val mcBytes = Array[Byte](OpCodes.PropertyCallCode, SCollection.typeId, freeMethodId, Outputs.opCode)
val v2vs = vs.updated(CheckAndGetMethodV6.id, ChangedRule(Array(SCollection.typeId, freeMethodId)))
checkRule(CheckAndGetMethodV6, v2vs, {
ValueSerializer.deserialize(mcBytes)
})
}
}

override protected def afterAll(): Unit = {
Expand Down

0 comments on commit 8aa8002

Please sign in to comment.