Skip to content

Commit

Permalink
merging deserialize PR updates into
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Aug 20, 2024
2 parents fc056d8 + 57e39be commit a8f1d66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion data/shared/src/main/scala/sigma/data/CHeader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ class CHeader(val ergoHeader: ErgoHeader) extends Header with WrapperOf[ErgoHead
}

override def checkPow: Boolean = {
Autolykos2PowValidation.checkPoWForVersion2(this)
if (version == 1) {
throw new Exception("Autolykos v1 is not supported") //todo: more specific exception?
} else {
Autolykos2PowValidation.checkPoWForVersion2(this)
}
}

override def toString: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import sigma.VersionContext.V6SoftForkVersion
import sigma.VersionContext
import sigma.data.{CAND, CAvlTree, CHeader, ProveDlog, SigmaBoolean, TrivialProp}
import sigma.data.{CAND, CAvlTree, ProveDlog, SigmaBoolean, TrivialProp}
import sigma.data.{CAND, CAvlTree, CHeader, ProveDlog, SigmaBoolean, TrivialProp}
import sigma.interpreter.ContextExtension
import scorex.util.encode.Base58
import sigma.VersionContext
import sigma.data.{AvlTreeData, CAND, ProveDlog, SigmaBoolean, TrivialProp}
import sigma.VersionContext.V6SoftForkVersion
Expand All @@ -39,7 +39,7 @@ class TestingInterpreterSpecification extends CompilerTestingCommons
lazy val prover = new ErgoLikeTestProvingInterpreter()

lazy val verifier = new ErgoLikeTestInterpreter

def testingContext(h: Int = 614401) = {
// bytes of real mainnet block header at height 614,440
val headerBytes = "02ac2101807f0000ca01ff0119db227f202201007f62000177a080005d440896d05d3f80dcff7f5e7f59007294c180808d0158d1ff6ba10000f901c7f0ef87dcfff17fffacb6ff7f7f1180d2ff7f1e24ffffe1ff937f807f0797b9ff6ebdae007e5c8c00b8403d3701557181c8df800001b6d5009e2201c6ff807d71808c00019780f087adb3fcdbc0b3441480887f80007f4b01cf7f013ff1ffff564a0000b9a54f00770e807f41ff88c00240000080c0250000000003bedaee069ff4829500b3c07c4d5fe6b3ea3d3bf76c5c28c1d4dcdb1bed0ade0c0000000000003105"
Expand Down Expand Up @@ -498,7 +498,7 @@ class TestingInterpreterSpecification extends CompilerTestingCommons
}

property("bytes") {

// checking hash of bytes(id) against known value
val source = s""" {
| val h = CONTEXT.headers(0)
Expand Down

0 comments on commit a8f1d66

Please sign in to comment.