// Push data and subsequently delete several entries
Push data and subsequently delete several entries
// Push data and subsequently delete several entries
func TestSmartContract_DeleteData(t *testing.T) {
	_ = createBufferAndRemoveApps(t)
	buffer, err := NewAlgorandBufferFromEnv()
	assert.Nil(t, err)
	data := map[string]string{
		"1000": "Astralis",
		"1001": "Vitality",
		"1002": "Gambit",
		"1003": "OG",
		"1004": "Na'Vi",
		"1005": "Furia",
	}
	ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
	err = buffer.PutElements(ctx, data)
	cancel()
	assert.Nil(t, err)
	ctx, cancel = context.WithTimeout(context.Background(), time.Second*30)
	err = buffer.DeleteElements(ctx, "1001", "1003")
	cancel()
	assert.Nil(t, err)
	assert.Nil(t, bufferLengthWithin(buffer, 4, time.Second*10))
}
func TestSmartContract_DeleteData ( t * testing . T ) { _ = createBufferAndRemoveApps ( t ) buffer , err := NewAlgorandBufferFromEnv ( ) assert . Nil ( t , err ) data := map [ string ] string { " " : " " , " " : " " , " " : " " , " " : " " , " " : " " , " " : " " , } ctx , cancel := context . WithTimeout ( context . Background ( ) , time . Second * 30 ) err = buffer . PutElements ( ctx , data ) cancel ( ) assert . Nil ( t , err ) ctx , cancel = context . WithTimeout ( context . Background ( ) , time . Second * 30 ) err = buffer . DeleteElements ( ctx , " " , " " ) cancel ( ) assert . Nil ( t , err ) assert . Nil ( t , bufferLengthWithin ( buffer , 4 , time . Second * 10 ) ) }
Push data and subsequently delete several entries
Push data and subsequently delete several entries
// Fill // Delete