diff --git a/finality-provider/service/fp_instance.go b/finality-provider/service/fp_instance.go index c4ce298e..007e4419 100644 --- a/finality-provider/service/fp_instance.go +++ b/finality-provider/service/fp_instance.go @@ -789,6 +789,10 @@ func (fp *FinalityProviderInstance) TestSubmitFinalitySignatureAndExtractPrivKey return nil, nil, fmt.Errorf("failed to send finality signature to the consumer chain: %w", err) } + if res.TxHash == "" { + return res, nil, nil + } + // try to extract the private key var privKey *btcec.PrivateKey for _, ev := range res.Events { diff --git a/itest/e2e_test.go b/itest/e2e_test.go index 5f8bcc33..b0891f91 100644 --- a/itest/e2e_test.go +++ b/itest/e2e_test.go @@ -1,6 +1,3 @@ -//go:build e2e -// +build e2e - package e2etest import ( @@ -87,9 +84,10 @@ func TestDoubleSigning(t *testing.T) { finalizedBlocks := tm.WaitForNFinalizedBlocks(t, 1) // test duplicate vote which should be ignored - _, extractedKey, err := fpIns.TestSubmitFinalitySignatureAndExtractPrivKey(finalizedBlocks[0]) + res, extractedKey, err := fpIns.TestSubmitFinalitySignatureAndExtractPrivKey(finalizedBlocks[0]) require.NoError(t, err) require.Nil(t, extractedKey) + require.Empty(t, res) t.Logf("duplicate vote for %d is sent", finalizedBlocks[0].Height) // attack: manually submit a finality vote over a conflicting block @@ -106,12 +104,6 @@ func TestDoubleSigning(t *testing.T) { require.True(t, localKey.Key.Equals(&extractedKey.Key) || localKey.Key.Negate().Equals(&extractedKey.Key)) t.Logf("the equivocation attack is successful") - - tm.WaitForFpShutDown(t) - - // try to start the finality provider and should expect err - err = tm.Fpa.StartHandlingFinalityProvider(fpIns.GetBtcPkBIP340(), "") - require.Error(t, err) } // TestFastSync tests the fast sync process where the finality-provider is terminated and restarted with fast sync