Skip to content

Commit

Permalink
Don't test app/lsig max size in goal clerk compile
Browse files Browse the repository at this point in the history
We now let goal clerk compile app program and lsig of any sizes,
even it they will be rejected by the nodes.
  • Loading branch information
giuliop committed Sep 10, 2024
1 parent 39600e5 commit 4de5dd0
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions test/e2e-go/cli/goal/expect/tealConsensusTest.exp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@ if { [catch {
"\n" { ::AlgorandGoal::Abort $expect_out(buffer) }
}

teal "$TEST_ROOT_DIR/big-sig.teal" 2 1001 1
spawn goal clerk compile "$TEST_ROOT_DIR/big-sig.teal"
expect {
-re {[A-Z2-9]{58}} { ::AlgorandGoal::Abort "hash" }
-re {.*logicsig program size too large} { puts "bigsigcheck: pass" }
eof { ::AlgorandGoal::Abort $expect_out(buffer) }
"\n" { ::AlgorandGoal::Abort $expect_out(buffer) }
}
# we do not test anymore for a max lsig size because we let goal compile any program size,
# even if they will be rejected by the nodes

#teal "$TEST_ROOT_DIR/big-sig.teal" 2 16001 1
#spawn goal clerk compile "$TEST_ROOT_DIR/big-sig.teal"
#expect {
# -re {[A-Z2-9]{58}} { ::AlgorandGoal::Abort "hash" }
# -re {.*logicsig program size too large} { puts "bigsigcheck: pass" }
# eof { ::AlgorandGoal::Abort $expect_out(buffer) }
# "\n" { ::AlgorandGoal::Abort $expect_out(buffer) }
#}

teal "$TEST_ROOT_DIR/barely-fits-app.teal" 2 4090 1 "int 0\nbalance\npop\n"
spawn goal clerk compile "$TEST_ROOT_DIR/barely-fits-app.teal"
Expand All @@ -71,15 +74,18 @@ if { [catch {
"\n" { ::AlgorandGoal::Abort $expect_out(buffer) }
}

# we do not test anymore for a max app program size because we let goal compile any program size,
# even if they will be rejected by the nodes

# MaxAppProgramLen = 2K * (1 + 3 pages max)
teal "$TEST_ROOT_DIR/big-app.teal" 2 8192 1 "int 0\nbalance\npop\n"
spawn goal clerk compile "$TEST_ROOT_DIR/big-app.teal"
expect {
-re {[A-Z2-9]{58}} { ::AlgorandGoal::Abort "hash" }
-re {.*app program size too large} { puts "bigappcheck: pass" }
eof { ::AlgorandGoal::Abort $expect_out(buffer) }
"\n" { ::AlgorandGoal::Abort $expect_out(buffer) }
}
#teal "$TEST_ROOT_DIR/big-app.teal" 2 8192 1 "int 0\nbalance\npop\n"
#spawn goal clerk compile "$TEST_ROOT_DIR/big-app.teal"
#expect {
# -re {[A-Z2-9]{58}} { ::AlgorandGoal::Abort "hash" }
# -re {.*app program size too large} { puts "bigappcheck: pass" }
# eof { ::AlgorandGoal::Abort $expect_out(buffer) }
# "\n" { ::AlgorandGoal::Abort $expect_out(buffer) }
#}

# Test cost limits during dryrun
exec goal clerk send -F "$TEST_ROOT_DIR/small-sig.teal" -t GXBNLU4AXQABPLHXJDMTG2YXSDT4EWUZACT7KTPFXDQW52XPTIUS5OZ5HQ -a 100 -d $TEST_PRIMARY_NODE_DIR -o $TEST_ROOT_DIR/small-sig.tx
Expand Down

0 comments on commit 4de5dd0

Please sign in to comment.