Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Damian Nolan <[email protected]>
  • Loading branch information
colin-axner and damiannolan authored Nov 29, 2022
1 parent af99600 commit ee02a0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion modules/core/02-client/migrations/v7/solomachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// client state and consensus state and migrate them to the new implementations. When the proto
// codec unmarshals, it calls UnpackInterfaces() to create a cached value of the any. The
// UnpackInterfaces function for IdenitifiedClientState will attempt to unpack the any to
// exported.ClientState. If the solomachine v1 type is not registered against the exported.ClientState
// exported.ClientState. If the solomachine v2 type is not registered against the exported.ClientState
// the unmarshal will fail. This implementation will panic on every interface function.
// The same is done for the ConsensusState.

Expand All @@ -27,6 +27,7 @@ var (
_ exported.ConsensusState = &ConsensusState{}
)

// RegisterInterfaces registers the solomachine v2 ClientState and ConsensusState types in the interface registry.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*exported.ClientState)(nil),
Expand Down
2 changes: 1 addition & 1 deletion modules/core/02-client/migrations/v7/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func collectClients(ctx sdk.Context, store sdk.KVStore, clientType string) (clie
clientID := host.MustParseClientStatePath(path)
clients = append(clients, clientID)

// optimization: exist after a single tendermint client iteration
// optimization: exit after a single tendermint client iteration
if strings.Contains(clientID, exported.Tendermint) {
return clients, nil
}
Expand Down
4 changes: 2 additions & 2 deletions modules/core/02-client/migrations/v7/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (suite *MigrationsV7TestSuite) TestMigrateStoreTendermint() {
}

// create multiple solo machine clients, tendermint and localhost clients
// ensure that solo machine clients are migrated and their cosnensus states are removed
// ensure that solo machine clients are migrated and their consensus states are removed
// ensure the localhost is deleted entirely.
func (suite *MigrationsV7TestSuite) TestMigrateStore() {
paths := []*ibctesting.Path{
Expand Down Expand Up @@ -87,7 +87,7 @@ func (suite *MigrationsV7TestSuite) TestMigrateStore() {
}

func (suite *MigrationsV7TestSuite) createSolomachineClients(solomachines []*ibctesting.Solomachine) {
// manually generate old proto buf definitions and set in store
// manually generate old protobuf definitions and set in store
// NOTE: we cannot use 'CreateClient' and 'UpdateClient' functions since we are
// using client states and consensus states which do not implement the exported.ClientState
// and exported.ConsensusState interface
Expand Down

0 comments on commit ee02a0b

Please sign in to comment.