Skip to content

Commit

Permalink
chore: add check for finality providers e2e test upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Aug 22, 2024
1 parent 5215030 commit c824ae0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions test/e2e/software_upgrade_e2e_signet_launch_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package e2e

import (
"sort"

"github.com/stretchr/testify/suite"

"github.com/babylonlabs-io/babylon/app"
Expand Down Expand Up @@ -76,4 +78,25 @@ func (s *SoftwareUpgradeSignetLaunchTestSuite) TestUpgradeSignetLaunch() {

s.EqualValues(headerInserted.Header.MarshalHex(), headerStoredResp.HeaderHex)
}

oldFPsLen := 0 // it should not have any FP
fpsFromNode := n.QueryFinalityProviders()
bbnApp := app.NewTmpBabylonApp()

fpsInserted, err := v1.LoadSignedFPsFromData(bbnApp.AppCodec(), bbnApp.TxConfig().TxJSONDecoder())
s.NoError(err)
s.Equal(len(fpsInserted), len(fpsFromNode)+oldFPsLen)

// sorts all the FPs from node to match the ones from loaded string json
sort.Slice(fpsFromNode, func(i, j int) bool {
return fpsFromNode[i].Addr > fpsFromNode[j].Addr
})

for i, fpInserted := range fpsInserted {
fpFromKeeper := fpsFromNode[i]
s.EqualValues(fpFromKeeper.Addr, fpInserted.Addr)
s.EqualValues(fpFromKeeper.Description, fpInserted.Description)
s.EqualValues(fpFromKeeper.Commission.String(), fpInserted.Commission.String())
s.EqualValues(fpFromKeeper.Pop.String(), fpInserted.Pop.String())
}
}
2 changes: 1 addition & 1 deletion test/e2e/upgrades/signet-launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"plan": {
"name": "signet-launch",
"time": "0001-01-01T00:00:00Z",
"height": "23",
"height": "21",
"info": "Msg info",
"upgraded_client_state": null
}
Expand Down

0 comments on commit c824ae0

Please sign in to comment.