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

Allow returning Tuples from instructions #3095

Open
ljiatu opened this issue Jul 20, 2024 · 1 comment
Open

Allow returning Tuples from instructions #3095

ljiatu opened this issue Jul 20, 2024 · 1 comment
Labels
idl related to the IDL, either program or client side

Comments

@ljiatu
Copy link

ljiatu commented Jul 20, 2024

Hi! From looking at the IDL, it seems like returning Tuples from instructions isn't supported yet because the returns section is missing. The program compiles and runs fine, but the client wouldn't be able to get the return value. We are currently using custom structs to get around this, but wondering if there is any plan to support Tuples.

Thanks!

@acheroncrypto acheroncrypto added the idl related to the IDL, either program or client side label Jul 20, 2024
@acheroncrypto
Copy link
Collaborator

Regular tuples are not supported, not just returning them. It's almost always preferred to use named structs for public data because it makes it easier to understand the type and allows more discoverability.

It's close to impossible to tell what (u64, u64, u32, u32) means without looking at the source code. In contrast, named structs remove a lot of the mental overhead by self-describing the fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idl related to the IDL, either program or client side
Projects
None yet
Development

No branches or pull requests

2 participants