From 7fdc39e2e496aea05bae5347295dc860b7310e38 Mon Sep 17 00:00:00 2001 From: RafilxTenfen Date: Tue, 30 Jul 2024 12:20:45 -0300 Subject: [PATCH] fix: reverse from chain stored --- test/e2e/software_upgrade_e2e_signet_launch_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/software_upgrade_e2e_signet_launch_test.go b/test/e2e/software_upgrade_e2e_signet_launch_test.go index 76ae3a5a9..bffbeaa70 100644 --- a/test/e2e/software_upgrade_e2e_signet_launch_test.go +++ b/test/e2e/software_upgrade_e2e_signet_launch_test.go @@ -53,14 +53,14 @@ func (s *SoftwareUpgradeSignetLaunchTestSuite) TestUpgradeSignetLaunch() { oldHeadersStoredLen := 1 // only block zero is set by default in genesis for e2e test storedBtcHeadersResp := n.QueryBtcLightClientMainchain() - newHeadersLen := len(storedBtcHeadersResp) - s.Equal(newHeadersLen, oldHeadersStoredLen+lenHeadersInserted) + storedHeadersLen := len(storedBtcHeadersResp) + s.Equal(storedHeadersLen, oldHeadersStoredLen+lenHeadersInserted) // ensure the headers were inserted at the end - for i := 0; i < newHeadersLen-lenHeadersInserted; i++ { - headerInserted := btcHeadersInserted[i] - headerStoredResp := storedBtcHeadersResp[oldHeadersStoredLen+i] + for i := 0; i < storedHeadersLen-lenHeadersInserted; i++ { + headerInsertedResp := btcHeadersInserted[i].ToResponse() + headerStoredResp := storedBtcHeadersResp[storedHeadersLen-(oldHeadersStoredLen+i)] // reverse - s.EqualValues(headerInserted.ToResponse(), headerStoredResp) + s.EqualValues(headerInsertedResp, headerStoredResp) } }