-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add constants table * Remove comments * Add some supporting info * Remove unchecked const * Add some tests for numeric and boolean * Add more checks * Simplfy test for byteArrayToBigInt * Test Box and Context * Remove uncompleted methods * Test Coll * Fix Coll typer tests * Fix comments * Some improvements, add TODO for BigInt test * Add getVar test * Finish testing * Empower apply test * Add STuple size test * Restrict tuple methods * Make it better * Mute advanced tuple operations typer test * add ir builder for Coll.append method (Append IR node); * Fix types.scala according new changes * Enable modular operations tests
- Loading branch information
1 parent
4b3ee12
commit d62d0ba
Showing
10 changed files
with
526 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.ergoplatform | ||
|
||
import sigmastate.{AtLeast, SBigInt, SPrimType} | ||
|
||
case class SizeConstant[T: Numeric](value: T, id: Short, description: String) { | ||
def get: T = value | ||
} | ||
|
||
/** | ||
* Fundamental constants that are used in sigma's logic and checks | ||
*/ | ||
object ErgoConstants { | ||
|
||
object MaxInputSize extends SizeConstant[Int](1024 * 1024 * 1, 1, | ||
"Input size should not be greater then provided value") { | ||
} | ||
|
||
object MaxTreeDepth extends SizeConstant[Int](110, 2, | ||
"Max tree depth should not be greater then provided value") { | ||
} | ||
|
||
object MaxByteArrayLength extends SizeConstant[Int](10000, 3, | ||
"Max bytearray length") { | ||
} | ||
|
||
object MaxTokens extends SizeConstant[Byte](4, 6, | ||
"Tokens count should not be greater than provided value") { | ||
} | ||
|
||
object MaxRegisters extends SizeConstant[Int](10, 7, | ||
"Registers count should not be greater than provided value") { | ||
} | ||
|
||
object MaxBoxSize extends SizeConstant[Int](64 * 1024, 8, | ||
"Box size should not be greater than provided value") { | ||
} | ||
|
||
object MaxBigIntSizeInBytes extends SizeConstant[Long](32L, 9, | ||
"BigInt size in bytes should not be greater than provided value") { | ||
} | ||
|
||
object MaxTupleLength extends SizeConstant[Int](255, 10, | ||
"Tuple length should not be greater than provided value") { | ||
} | ||
|
||
object MaxHeaders extends SizeConstant[Int](10, 11, | ||
"Headers count should not be greater than provided value") { | ||
} | ||
|
||
object MaxChildrenCountForAtLeastOp extends SizeConstant[Int](255, 12, | ||
"Max children count should not be greater than provided value") { | ||
} | ||
|
||
val ConstTable: Seq[SizeConstant[_]] = Seq( | ||
MaxInputSize, | ||
MaxTreeDepth, | ||
MaxByteArrayLength, | ||
MaxTokens, | ||
MaxRegisters, | ||
MaxBoxSize, | ||
MaxBigIntSizeInBytes, | ||
MaxTupleLength, | ||
MaxHeaders, | ||
MaxChildrenCountForAtLeastOp | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.