@@ -199,22 +199,26 @@ func TestFetchTransactionReceiptBasic(t *testing.T) {
199199 go func (i int , txnHash common.Hash ) {
200200 defer wg .Done ()
201201
202- receipt , waitFinality , err := receiptsListener .FetchTransactionReceipt (ctx , txnHash , 7 )
202+ receipt , err := receiptsListener .FetchTransactionReceipt (ctx , txnHash , 7 )
203203 require .NoError (t , err )
204204 require .NotNil (t , receipt )
205205 require .True (t , receipt .Status () == types .ReceiptStatusSuccessful )
206206 require .False (t , receipt .Final )
207-
208207 t .Logf ("=> MINED %d :: %s" , i , receipt .TransactionHash ().String ())
209208
210- _ = waitFinality
211- finalReceipt , err := waitFinality (context .Background ())
212- require .NoError (t , err )
213- require .NotNil (t , finalReceipt )
214- require .True (t , finalReceipt .Status () == types .ReceiptStatusSuccessful )
215- require .True (t , finalReceipt .Final )
216-
217- t .Logf ("=> FINAL %d :: %s" , i , receipt .TransactionHash ().String ())
209+ // receipt, waitFinality, err := receiptsListener.FetchTransactionReceiptWithFinality(ctx, txnHash, 7)
210+ // require.NoError(t, err)
211+ // require.NotNil(t, receipt)
212+ // require.True(t, receipt.Status() == types.ReceiptStatusSuccessful)
213+ // require.False(t, receipt.Final)
214+ // t.Logf("=> MINED %d :: %s", i, receipt.TransactionHash().String())
215+ //
216+ // finalReceipt, err := waitFinality(context.Background())
217+ // require.NoError(t, err)
218+ // require.NotNil(t, finalReceipt)
219+ // require.True(t, finalReceipt.Status() == types.ReceiptStatusSuccessful)
220+ // require.True(t, finalReceipt.Final)
221+ // t.Logf("=> FINAL %d :: %s", i, receipt.TransactionHash().String())
218222 }(i , txnHash )
219223 }
220224 wg .Wait ()
@@ -226,7 +230,7 @@ func TestFetchTransactionReceiptBasic(t *testing.T) {
226230 require .Equal (t , 1 , monitor .NumSubscribers ())
227231
228232 // Testing exhausted filter after maxWait period is unable to find non-existant txn hash
229- receipt , waitFinality , err := receiptsListener .FetchTransactionReceipt (ctx , ethkit.Hash {1 , 2 , 3 , 4 }, 5 )
233+ receipt , waitFinality , err := receiptsListener .FetchTransactionReceiptWithFinality (ctx , ethkit.Hash {1 , 2 , 3 , 4 }, 5 )
230234 require .Error (t , err )
231235 require .True (t , errors .Is (err , ethreceipts .ErrFilterExhausted ))
232236 require .Nil (t , receipt )
@@ -245,7 +249,7 @@ func TestFetchTransactionReceiptBasic(t *testing.T) {
245249 monitor .PurgeHistory ()
246250 receiptsListener .PurgeHistory ()
247251
248- receipt , waitFinality , err = receiptsListener .FetchTransactionReceipt (ctx , txnHashes [0 ])
252+ receipt , waitFinality , err = receiptsListener .FetchTransactionReceiptWithFinality (ctx , txnHashes [0 ])
249253 require .NoError (t , err )
250254 require .NotNil (t , receipt )
251255 finalReceipt , err = waitFinality (context .Background ())
@@ -256,7 +260,7 @@ func TestFetchTransactionReceiptBasic(t *testing.T) {
256260 // wait enough time, so that the fetched receipt will come as finalized right away
257261 time .Sleep (5 * time .Second )
258262
259- receipt , waitFinality , err = receiptsListener .FetchTransactionReceipt (ctx , txnHashes [1 ])
263+ receipt , waitFinality , err = receiptsListener .FetchTransactionReceiptWithFinality (ctx , txnHashes [1 ])
260264 require .NoError (t , err )
261265 require .NotNil (t , receipt )
262266 require .True (t , receipt .Final )
@@ -349,7 +353,7 @@ func TestFetchTransactionReceiptBlast(t *testing.T) {
349353 go func (i int , txnHash common.Hash ) {
350354 defer wg .Done ()
351355
352- receipt , receiptFinality , err := receiptsListener .FetchTransactionReceipt (ctx , txnHash )
356+ receipt , receiptFinality , err := receiptsListener .FetchTransactionReceiptWithFinality (ctx , txnHash )
353357 assert .NoError (t , err )
354358 assert .NotNil (t , receipt )
355359 assert .True (t , receipt .Status () == types .ReceiptStatusSuccessful )
@@ -574,7 +578,7 @@ func TestReceiptsListenerERC20(t *testing.T) {
574578 ethreceipts .FilterLogTopic (erc20TransferTopic ).Finalize (true ).ID (9999 ).MaxWait (3 ),
575579
576580 // won't be found..
577- ethreceipts .FilterFrom (ethkit.Address {}).MaxWait (0 ).ID (8888 ),
581+ ethreceipts .FilterFrom (ethkit.Address {1 , 2 , 3 , 4 }).MaxWait (0 ).ID (8888 ),
578582
579583 // ethreceipts.FilterLogs(func(logs []*types.Log) bool {
580584 // for _, log := range logs {
@@ -674,6 +678,8 @@ loop:
674678 assert .True (t , found , "looking for matched receipt %s" , mr .TransactionHash ().String ())
675679 }
676680
681+ t .Logf ("matchedCount: %d" , matchedCount )
682+ t .Logf ("erc20Receipts: %d" , len (erc20Receipts ))
677683 require .Equal (t , matchedCount , len (erc20Receipts )* 2 )
678684}
679685
0 commit comments