summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTsachi Herman <tsachi.herman@algorand.com>2022-02-22 17:16:28 -0500
committerTsachi Herman <tsachi.herman@algorand.com>2022-02-22 17:16:28 -0500
commit8b287389d3cb8b169a535d6c9340628587447d67 (patch)
tree32dcb43397d1f50030caa6486d7f97d8403e3be7
parentfab02546c09c0c2cf816e67018cfb5954486c0fe (diff)
update per CR
-rw-r--r--ledger/apply/application.go9
-rw-r--r--ledger/apply/application_test.go21
2 files changed, 1 insertions, 29 deletions
diff --git a/ledger/apply/application.go b/ledger/apply/application.go
index f9707a95b..1e8c48c70 100644
--- a/ledger/apply/application.go
+++ b/ledger/apply/application.go
@@ -68,11 +68,6 @@ func createApplication(ac *transactions.ApplicationCallTxnFields, balances Balan
// look up how many apps they have
totalAppParams := record.TotalAppParams
- if !balances.ConsensusParams().Application {
- err = fmt.Errorf("cannot create app for %s: applications not supported", creator.String())
- return
- }
-
// Make sure the creator isn't already at the app creation max
maxAppsCreated := balances.ConsensusParams().MaxAppsCreated
if maxAppsCreated > 0 && totalAppParams >= uint64(maxAppsCreated) {
@@ -228,10 +223,6 @@ func optInApplication(balances Balances, sender basics.Address, appIdx basics.Ap
return err
}
- if !balances.ConsensusParams().Application {
- return fmt.Errorf("cannot opt in app %d for %s: applications not supported", appIdx, sender.String())
- }
-
// If the user has already opted in, fail
// future optimization: find a way to avoid testing this in case record.TotalAppLocalStates == 0.
ok, err := balances.HasAppLocalState(sender, appIdx)
diff --git a/ledger/apply/application_test.go b/ledger/apply/application_test.go
index 018b084c7..dd6213318 100644
--- a/ledger/apply/application_test.go
+++ b/ledger/apply/application_test.go
@@ -486,11 +486,6 @@ func TestAppCallCreate(t *testing.T) {
b.balances = make(map[basics.Address]basics.AccountData)
b.balances[creator] = basics.AccountData{}
- b.SetProto(protocol.ConsensusV18) // pre-application.
- _, err = createApplication(&ac, b, creator, txnCounter)
- a.Error(err)
- a.Contains(err.Error(), "applications not supported")
-
b.SetProto(protocol.ConsensusFuture)
ac.ApprovalProgram = []byte{1}
ac.ClearStateProgram = []byte{2}
@@ -542,13 +537,6 @@ func TestAppCallApplyCreate(t *testing.T) {
b.balances[creator] = basics.AccountData{}
var ad *transactions.ApplyData = &transactions.ApplyData{}
- b.SetProto(protocol.ConsensusV18) // before applications support
- err = ApplicationCall(ac, h, b, ad, 0, &ep, txnCounter)
- a.Error(err)
- a.Contains(err.Error(), "applications not supported")
- a.Zero(b.put)
- a.Zero(b.putAppParams)
-
b.SetProto(protocol.ConsensusFuture)
proto := b.ConsensusParams()
ep.Proto = &proto
@@ -686,15 +674,8 @@ func TestAppCallOptIn(t *testing.T) {
var params basics.AppParams
- b.SetProto(protocol.ConsensusV18) // before applications support.
- err := optInApplication(b, sender, appIdx, params)
- a.Error(err)
- a.Contains(err.Error(), "cannot opt in app")
- a.Zero(b.put)
- a.Zero(b.putAppLocalState)
-
b.SetProto(protocol.ConsensusFuture)
- err = optInApplication(b, sender, appIdx, params)
+ err := optInApplication(b, sender, appIdx, params)
a.NoError(err)
a.Equal(1, b.put)
a.Equal(1, b.putAppLocalState)