@@ -6,6 +6,7 @@ package e2etest
6
6
import (
7
7
"context"
8
8
"encoding/hex"
9
+ "errors"
9
10
"fmt"
10
11
"math"
11
12
"testing"
@@ -518,7 +519,7 @@ func (tm *TestManager) updateSchnorSigInDb(newSig *schnorr.Signature, txHash *ch
518
519
require .NoError (tm .t , err )
519
520
}
520
521
521
- func TestReSendingFailedTransactions (t * testing.T ) {
522
+ func TestHandlingCriticalError (t * testing.T ) {
522
523
m := StartManager (t , 10 )
523
524
d := defaultStakingData ()
524
525
@@ -553,26 +554,10 @@ func TestReSendingFailedTransactions(t *testing.T) {
553
554
554
555
// 2. Run pipeline
555
556
err = m .pipeLine .ProcessNewTransactions (context .Background ())
556
- require .NoError (t , err )
557
-
558
- // 3. There should be one failed transaction
559
- failedTx , err := m .testStoreController .GetFailedUnbondingTransactions (context .TODO ())
560
- require .NoError (t , err )
561
- require .Len (t , failedTx , 1 )
557
+ require .Error (t , err )
558
+ // With invalid signature in db, signers will refuse to sign it, which should end
559
+ // with critical error
560
+ require .True (t , errors .Is (err , services .ErrCriticalError ))
562
561
563
- // 4. Fix sig in db
564
- unbondingTxHash := unbondingTx .unbondingTx .TxHash ()
565
- m .updateSchnorSigInDb (unbondingTx .signature , & unbondingTxHash )
566
-
567
- // 5. Run pipeline for failed tx
568
- err = m .pipeLine .ProcessFailedTransactions (context .Background ())
569
- require .NoError (t , err )
570
-
571
- failedTxNew , err := m .testStoreController .GetFailedUnbondingTransactions (context .TODO ())
572
- require .NoError (t , err )
573
- require .Len (t , failedTxNew , 0 )
574
-
575
- sendUnbondingTx , err := m .testStoreController .GetSendUnbondingTransactions (context .TODO ())
576
- require .NoError (t , err )
577
- require .Len (t , sendUnbondingTx , 1 )
562
+ // TODO:Find a way to simulate bitcoind not accepting transaction
578
563
}
0 commit comments