Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): return client identifier in create client response. #6886

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading