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

DecCoin from cosmos sdk is not properly encoded/decoded #734

Open
stalniy opened this issue Feb 27, 2025 · 1 comment
Open

DecCoin from cosmos sdk is not properly encoded/decoded #734

stalniy opened this issue Feb 27, 2025 · 1 comment

Comments

@stalniy
Copy link

stalniy commented Feb 27, 2025

Problem

DecCoin from cosmos sdk is not properly encoded/decoded is marked as Dec via option (gogoproto.customtype) = "Dec" but telescope doesn't properly processes it because cosmos proto specifies (gogoproto.customtype) = "Dec" for DecCoin['amount'] field and go_package is specified in the same file at the top. BUT telescope generator expects this option to be fully qualified (i.e., expects (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec").

It means that protofiles parser doesn't take into account option go_package at file level and produces incorrect AST for DecCoin['amount'] field

Additional context

I did some debugging of source code and found out that indeed parser receives Dec (not github.com/cosmos/cosmos-sdk/types.Dec) in args.field.options?.['(gogoproto.customtype)'] that's why encode/decode functions are not properly generated for DecCoin['amount'] property

@baktun14
Copy link

baktun14 commented Mar 4, 2025

Hey @pyramation , could you guys take a look at this issue please?

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

No branches or pull requests

2 participants