Skip to content

Commit

Permalink
fix flaky e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianElvis authored and maurolacy committed Jul 5, 2024
1 parent afc50e6 commit 49a3252
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions itest/test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,3 +828,20 @@ func ParseRespBTCDelToBTCDel(resp *bstypes.BTCDelegationResponse) (btcDel *bstyp

return btcDel, nil
}

func (tm *TestManager) InsertWBTCHeaders(t *testing.T, r *rand.Rand) {
params, err := tm.BBNClient.QueryStakingParams()
require.NoError(t, err)
btcTipResp, err := tm.BBNClient.QueryBtcLightClientTip()
require.NoError(t, err)
tipHeader, err := bbntypes.NewBTCHeaderBytesFromHex(btcTipResp.HeaderHex)
require.NoError(t, err)
kHeaders := datagen.NewBTCHeaderChainFromParentInfo(r, &btclctypes.BTCHeaderInfo{
Header: &tipHeader,
Hash: tipHeader.Hash(),
Height: btcTipResp.Height,
Work: &btcTipResp.Work,
}, uint32(params.FinalizationTimeoutBlocks))
_, err = tm.BBNClient.InsertBtcBlockHeaders(kHeaders.ChainToBytes())
require.NoError(t, err)
}

0 comments on commit 49a3252

Please sign in to comment.