Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Nov 11, 2024
1 parent 56914c6 commit 52b0829
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions finality-provider/service/fp_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build e2e
// +build e2e

package e2etest

import (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 52b0829

Please sign in to comment.