Skip to content

Commit

Permalink
Rename solomachine clients identifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim committed Mar 25, 2024
1 parent 446d7c4 commit 0817f12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions modules/light-clients/06-solomachine/light_client_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
)

func (suite *SoloMachineTestSuite) TestStatus() {
clientID := suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), exported.Solomachine)
clientID := suite.solomachine.ClientID
clientState := suite.solomachine.ClientState()

// Set a client state in store.
Expand All @@ -45,7 +45,7 @@ func (suite *SoloMachineTestSuite) TestStatus() {
}

func (suite *SoloMachineTestSuite) TestGetTimestampAtHeight() {
clientID := suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), exported.Solomachine)
clientID := suite.solomachine.ClientID
height := clienttypes.NewHeight(0, suite.solomachine.ClientState().Sequence)
// Single setup for all test cases.
suite.SetupTest()
Expand Down Expand Up @@ -92,7 +92,6 @@ func (suite *SoloMachineTestSuite) TestGetTimestampAtHeight() {
}

func (suite *SoloMachineTestSuite) TestVerifyMembership() {
var clientID string
// test singlesig and multisig public keys
for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} {

Expand Down Expand Up @@ -534,7 +533,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() {
tc.malleate()

// Generate clientID
clientID = suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), exported.Solomachine)
clientID := sm.ClientID

// Set the client state in the store for light client call to find.
suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), clientID, clientState)
Expand Down Expand Up @@ -760,7 +759,7 @@ func (suite *SoloMachineTestSuite) TestVerifyNonMembership() {
}

// Generate clientID
clientID := suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), exported.Solomachine)
clientID := sm.ClientID

// Set the client state in the store for light client call to find.
suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), clientID, clientState)
Expand Down Expand Up @@ -891,7 +890,7 @@ func (suite *SoloMachineTestSuite) TestRecoverClient() {
}

func (suite *SoloMachineTestSuite) TestVerifyUpgradeAndUpdateState() {
clientID := suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), exported.Solomachine)
clientID := suite.solomachine.ClientID

lightClientModule, found := suite.chainA.GetSimApp().IBCKeeper.ClientKeeper.Route(clientID)
suite.Require().True(found)
Expand Down
4 changes: 2 additions & 2 deletions modules/light-clients/06-solomachine/solomachine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (suite *SoloMachineTestSuite) SetupTest() {
suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1))
suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2))

suite.solomachine = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachinesingle", "testing", 1)
suite.solomachineMulti = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachinemulti", "testing", 4)
suite.solomachine = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "06-solomachine-1", "testing", 1)
suite.solomachineMulti = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "06-solomachine-2", "testing", 4)

suite.store = suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), exported.Solomachine)
}
Expand Down

0 comments on commit 0817f12

Please sign in to comment.