Skip to content

Commit

Permalink
Add unit test for lsig arg size
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliop committed Oct 23, 2024
1 parent 1872212 commit 34d6079
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions data/transactions/logic/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,24 @@ func TestTooManyArgs(t *testing.T) {
}
}

func TestArgTooLarge(t *testing.T) {
partitiontest.PartitionTest(t)

t.Parallel()
for v := uint64(1); v <= AssemblerMaxVersion; v++ {
t.Run(fmt.Sprintf("v=%d", v), func(t *testing.T) {
ops := testProg(t, "int 1", v)
var txn transactions.SignedTxn
txn.Lsig.Logic = ops.Program
txn.Lsig.Args = [][]byte{make([]byte, transactions.MaxLogicSigArgSize+1)}
pass, err := EvalSignature(0, defaultSigParams(txn))
require.Error(t, err)
require.False(t, pass)
})
}

}

func TestEmptyProgram(t *testing.T) {
partitiontest.PartitionTest(t)

Expand Down

0 comments on commit 34d6079

Please sign in to comment.