Skip to content

Commit

Permalink
feat(core): return client identifier in create client response. (#6886)
Browse files Browse the repository at this point in the history
(cherry picked from commit aefc31d)
  • Loading branch information
DimitrisJim authored and mergify[bot] committed Jul 19, 2024
1 parent 01e33e0 commit 81b93ca
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 53 deletions.
145 changes: 95 additions & 50 deletions modules/core/02-client/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ func (k *Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateC
return nil, err
}

if _, err = k.ClientKeeper.CreateClient(ctx, clientState.ClientType(), msg.ClientState.Value, msg.ConsensusState.Value); err != nil {
clientID, err := k.ClientKeeper.CreateClient(ctx, clientState.ClientType(), msg.ClientState.Value, msg.ConsensusState.Value)
if err != nil {
return nil, err
}

return &clienttypes.MsgCreateClientResponse{}, nil
return &clienttypes.MsgCreateClientResponse{ClientId: clientID}, nil
}

// UpdateClient defines a rpc handler method for MsgUpdateClient.
Expand Down
6 changes: 5 additions & 1 deletion proto/ibc/core/client/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ message MsgCreateClient {
}

// MsgCreateClientResponse defines the Msg/CreateClient response type.
message MsgCreateClientResponse {}
message MsgCreateClientResponse {
option (gogoproto.goproto_getters) = false;

string client_id = 1;
}

// MsgUpdateClient defines an sdk.Msg to update a IBC client state using
// the given client message.
Expand Down

0 comments on commit 81b93ca

Please sign in to comment.