Skip to content

Commit

Permalink
Added MaxComplexityByVersion function (#2394)
Browse files Browse the repository at this point in the history
  • Loading branch information
siemarell authored and Sergey Nazarov committed Jun 21, 2019
1 parent 8b568b7 commit f681869
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lang/js/src/main/scala/JsAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ object JsAPI {
.toJSArray

@JSExportTopLevel("contractLimits")
def contractLimits(ver: Int = 2): js.Dynamic = {
val version = DirectiveDictionary[StdLibVersion].idMap(ver)
def contractLimits(): js.Dynamic = {
js.Dynamic.literal(
"MaxExprComplexity" -> ContractLimits.MaxComplexityByVersion(version),
"MaxComplexityByVersion" -> ((ver: Int) => ContractLimits.MaxComplexityByVersion(DirectiveDictionary[StdLibVersion].idMap(ver))),
"MaxExprSizeInBytes" -> ContractLimits.MaxExprSizeInBytes,
"MaxContractComplexity" -> ContractLimits.MaxComplexityByVersion(version),
"MaxContractSizeInBytes" -> ContractLimits.MaxContractSizeInBytes,
"MaxInvokeScriptArgs" -> ContractLimits.MaxInvokeScriptArgs,
"MaxInvokeScriptSizeInBytes" -> ContractLimits.MaxInvokeScriptSizeInBytes,
Expand Down

0 comments on commit f681869

Please sign in to comment.