Skip to content

Commit

Permalink
imp: emit defaults when marshalling clienttypes.Height to json (#6640)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Rodriguez <[email protected]>
  • Loading branch information
damiannolan and crodriguezvega authored Jul 26, 2024
1 parent 4e0abfb commit 87ebe18
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
66 changes: 35 additions & 31 deletions modules/core/02-client/types/client.pb.go

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

7 changes: 5 additions & 2 deletions proto/ibc/core/client/v1/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ message ClientConsensusStates {
// breaking changes In these cases, the RevisionNumber is incremented so that
// height continues to be monitonically increasing even as the RevisionHeight
// gets reset
//
// Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag.
// This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height.
message Height {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

// the revision that the client is currently on
uint64 revision_number = 1;
uint64 revision_number = 1 [(gogoproto.jsontag) = "revision_number"];
// the height within the given revision
uint64 revision_height = 2;
uint64 revision_height = 2 [(gogoproto.jsontag) = "revision_height"];
}

// Params defines the set of IBC light client parameters.
Expand Down

0 comments on commit 87ebe18

Please sign in to comment.