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

refactor(proto): non-nullable proto arrays #2130

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

corverroos
Copy link
Collaborator

Refactors all cosmos module query protos array fields to be non-nullable. This changes the generated types from pointers to non-points. This avoid the need for nil checks.

Nice thing is that the wire serialization remain identical, only runtime types are different, which means this is backwards compatible!

issue: none

@@ -5,12 +5,12 @@
"Msgs": [
{
"SourceChainID": 77,
"DestChainID": 1894687307556873581,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is just due to fuzzing that follows a different path and doesn't break things on the wire.

@@ -25,7 +26,7 @@ message MsgExecutionPayload {
option (cosmos.msg.v1.signer) = "authority";
string authority = 1;
bytes execution_payload = 2;
repeated EVMEvent prev_payload_events = 3;
repeated EVMEvent prev_payload_events = 3 [(gogoproto.nullable) = false];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💸

Copy link
Contributor

@sideninja sideninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

@corverroos corverroos merged commit 4c7dfbb into main Oct 10, 2024
18 checks passed
@corverroos corverroos deleted the corver/nullablerepeat branch October 10, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants