From 34d607927a3c024b9e729a4eb6ae208f21cae1f9 Mon Sep 17 00:00:00 2001 From: giulio Date: Wed, 23 Oct 2024 15:56:49 +0200 Subject: [PATCH] Add unit test for lsig arg size --- data/transactions/logic/eval_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index c8f7a8bc5f..8f93fa564b 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -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)