Skip to content

Commit 235c9d0

Browse files
committed
don't run pointless test while AVM is more advanced than vFuture
1 parent 584df1f commit 235c9d0

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

ledger/simulation/simulation_eval_test.go

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6961,6 +6961,9 @@ func TestUnnamedResources(t *testing.T) {
69616961
env.OptIntoApp(otherAppUser, otherAppID)
69626962

69636963
proto := env.TxnInfo.CurrentProtocolParams()
6964+
if v > int(proto.LogicSigVersion) {
6965+
t.Skip("not testing in unsupported proto")
6966+
}
69646967
expectedUnnamedResourceGroupAssignment := &simulation.ResourceTracker{
69656968
MaxAccounts: proto.MaxTxGroupSize * (proto.MaxAppTxnAccounts + proto.MaxAppTxnForeignApps),
69666969
MaxAssets: proto.MaxTxGroupSize * proto.MaxAppTxnForeignAssets,
@@ -7196,6 +7199,11 @@ func TestUnnamedResourcesAccountLocalWrite(t *testing.T) {
71967199
sender := env.Accounts[0]
71977200
testAppUser := env.Accounts[1].Addr
71987201

7202+
proto := env.TxnInfo.CurrentProtocolParams()
7203+
if v > int(proto.LogicSigVersion) {
7204+
t.Skip("not testing in unsupported proto")
7205+
}
7206+
71997207
program := fmt.Sprintf(`#pragma version %d
72007208
txn ApplicationID
72017209
!
@@ -7232,7 +7240,6 @@ int 1
72327240
})
72337241
stxn := txn.Txn().Sign(sender.Sk)
72347242

7235-
proto := env.TxnInfo.CurrentProtocolParams()
72367243
expectedUnnamedResourceAssignment := &simulation.ResourceTracker{
72377244
MaxAccounts: proto.MaxTxGroupSize * (proto.MaxAppTxnAccounts + proto.MaxAppTxnForeignApps),
72387245
MaxAssets: proto.MaxTxGroupSize * proto.MaxAppTxnForeignAssets,
@@ -7338,6 +7345,11 @@ func TestUnnamedResourcesCreatedAppsAndAssets(t *testing.T) {
73387345
t.Run(fmt.Sprintf("v%d", v), func(t *testing.T) {
73397346
t.Parallel()
73407347
simulationTest(t, func(env simulationtesting.Environment) simulationTestCase {
7348+
proto := env.TxnInfo.CurrentProtocolParams()
7349+
if v > int(proto.LogicSigVersion) {
7350+
t.Skip("not testing in unsupported proto")
7351+
}
7352+
73417353
sender := env.Accounts[0]
73427354
otherResourceCreator := env.Accounts[1]
73437355
otherAccount := env.Accounts[2].Addr
@@ -7435,7 +7447,6 @@ int 1
74357447
appCreateStxn := appCreateTxn.Txn().Sign(otherResourceCreator.Sk)
74367448
appCallStxn := appCallTxn.Txn().Sign(sender.Sk)
74377449

7438-
proto := env.TxnInfo.CurrentProtocolParams()
74397450
expectedUnnamedResourceAssignment := simulation.ResourceTracker{
74407451
MaxAccounts: (proto.MaxTxGroupSize - 1) * (proto.MaxAppTxnAccounts + proto.MaxAppTxnForeignApps),
74417452
MaxAssets: (proto.MaxTxGroupSize - 1) * proto.MaxAppTxnForeignAssets,
@@ -7702,15 +7713,18 @@ func TestUnnamedResourcesBoxIOBudget(t *testing.T) {
77027713
env := simulationtesting.PrepareSimulatorTest(t)
77037714
defer env.Close()
77047715

7716+
proto := env.TxnInfo.CurrentProtocolParams()
7717+
if v > int(proto.LogicSigVersion) {
7718+
t.Skip("not testing in unsupported proto")
7719+
}
7720+
77057721
sender := env.Accounts[0]
77067722

77077723
appID := env.CreateApp(sender.Addr, simulationtesting.AppParams{
77087724
ApprovalProgram: fmt.Sprintf(boxTestProgram, v),
77097725
ClearStateProgram: fmt.Sprintf("#pragma version %d\n int 1", v),
77107726
})
77117727

7712-
proto := env.TxnInfo.CurrentProtocolParams()
7713-
77147728
// MBR is needed for boxes.
77157729
transferable := env.Accounts[1].AcctData.MicroAlgos.Raw - proto.MinBalance - proto.MinTxnFee
77167730
env.TransferAlgos(env.Accounts[1].Addr, appID.Address(), transferable)
@@ -8587,6 +8601,10 @@ func TestUnnamedResourcesLimits(t *testing.T) {
85878601
defer env.Close()
85888602

85898603
proto := env.TxnInfo.CurrentProtocolParams()
8604+
if v > int(proto.LogicSigVersion) {
8605+
t.Skip("not testing in unsupported proto")
8606+
return
8607+
}
85908608

85918609
sender := env.Accounts[0]
85928610
otherAccounts := make([]basics.Address, len(env.Accounts)-1)
@@ -8753,6 +8771,10 @@ func TestUnnamedResourcesCrossProductLimits(t *testing.T) {
87538771
defer env.Close()
87548772

87558773
proto := env.TxnInfo.CurrentProtocolParams()
8774+
if v > int(proto.LogicSigVersion) {
8775+
t.Skip("not testing in unsupported proto")
8776+
return
8777+
}
87568778

87578779
sender := env.Accounts[0]
87588780
otherAccounts := make([]basics.Address, proto.MaxTxGroupSize)

0 commit comments

Comments
 (0)