@@ -2206,6 +2206,17 @@ func TestDeleteTransactions(t *testing.T) {
22062206 err := db .DeleteTransactions (context .Background (), 2 )
22072207 assert .NoError (t , err )
22082208
2209+ // verify txn_participation only has records for rounds >= 2
2210+ var minRound uint64
2211+ err = db .db .QueryRow (context .Background (), "SELECT MIN(round) FROM txn_participation" ).Scan (& minRound )
2212+ require .NoError (t , err )
2213+ assert .GreaterOrEqual (t , minRound , uint64 (2 ), "txn_participation should only have records for rounds >= 2" )
2214+
2215+ var participationRoundsLessThan2 int
2216+ err = db .db .QueryRow (context .Background (), "SELECT COUNT(*) FROM txn_participation WHERE round < 2" ).Scan (& participationRoundsLessThan2 )
2217+ require .NoError (t , err )
2218+ assert .Equal (t , 0 , participationRoundsLessThan2 , "txn_participation should not have any records for round < 2" )
2219+
22092220 // query txns
22102221 rowsCh , _ := db .Transactions (context .Background (), idb.TransactionFilter {})
22112222
@@ -2237,6 +2248,16 @@ func TestDeleteTransactions(t *testing.T) {
22372248 err = db .DeleteTransactions (context .Background (), 5 )
22382249 assert .NoError (t , err )
22392250
2251+ // verify txn_participation only has records for rounds >= 5
2252+ err = db .db .QueryRow (context .Background (), "SELECT MIN(round) FROM txn_participation" ).Scan (& minRound )
2253+ require .NoError (t , err )
2254+ assert .GreaterOrEqual (t , minRound , uint64 (5 ), "txn_participation should only have records for rounds >= 5" )
2255+
2256+ var participationRoundsLessThan5 int
2257+ err = db .db .QueryRow (context .Background (), "SELECT COUNT(*) FROM txn_participation WHERE round < 5" ).Scan (& participationRoundsLessThan5 )
2258+ require .NoError (t , err )
2259+ assert .Equal (t , 0 , participationRoundsLessThan5 , "txn_participation should not have any records for round < 5" )
2260+
22402261 // 2 txns in round 5
22412262 rowsCh , _ = db .Transactions (context .Background (), idb.TransactionFilter {})
22422263 i = 0
0 commit comments