// Test if the smart contract rejects ClearState, CloseOut, OptIn, and
// Update.
Test if the smart contract rejects ClearState, CloseOut, OptIn, and
Update.
// Test if the smart contract rejects ClearState CloseOut OptIn and // Update .
func TestSmartContract_RejectNonSupportedOps(t *testing.T) {
	_ = createBufferAndRemoveApps(t)
	buffer, err := NewAlgorandBufferFromEnv()
	assert.Nil(t, err)
	denyOc := []types.OnCompletion{
		types.ClearStateOC,
		types.OptInOC,
		types.CloseOutOC,
		types.UpdateApplicationOC,
	}
	params, err := buffer.Client.SuggestedParams(context.Background())
	assert.Nil(t, err)
	for _, oc := range denyOc {
		txn, err := client.GenerateApplicationCallTx(buffer.AppId, buffer.AccountCrypt, params, oc)
		assert.Nil(t, err)
		ctx, cancel := context.WithTimeout(context.Background(), client.AlgorandDefaultTimeout)
		_, err = buffer.Client.ExecuteTransaction(buffer.AccountCrypt, txn, ctx)
		cancel()
		assert.NotNil(t, err)
	}
}
func TestSmartContract_RejectNonSupportedOps ( t * testing . T ) { _ = createBufferAndRemoveApps ( t ) buffer , err := NewAlgorandBufferFromEnv ( ) assert . Nil ( t , err ) denyOc := [ ] types . OnCompletion { types . ClearStateOC , types . OptInOC , types . CloseOutOC , types . UpdateApplicationOC , } params , err := buffer . Client . SuggestedParams ( context . Background ( ) ) assert . Nil ( t , err ) for _ , oc := range denyOc { txn , err := client . GenerateApplicationCallTx ( buffer . AppId , buffer . AccountCrypt , params , oc ) assert . Nil ( t , err ) ctx , cancel := context . WithTimeout ( context . Background ( ) , client . AlgorandDefaultTimeout ) _ , err = buffer . Client . ExecuteTransaction ( buffer . AccountCrypt , txn , ctx ) cancel ( ) assert . NotNil ( t , err ) } }
Test if the smart contract rejects ClearState, CloseOut, OptIn, and
Update.
Test if the smart contract rejects ClearState CloseOut OptIn and Update .
// OnCompletion Teal ops that should be rejected // Get Parameters // Deny every transaction with the // Execute Transaction