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(pop-api): create explicit types for function id and version #285

Open
peterwht opened this issue Sep 12, 2024 · 1 comment
Open
Labels
low priority nice-to-have not necessary, but would be nice-to-have

Comments

@peterwht
Copy link
Collaborator

The pop-api should use explicit types for function id and version. By relying on constants, someone can accidentally switch the order of a function id and version and there will be no error.

See here: https://github.com/r0gue-io/pop-node/blob/daan/api/pop-api/src/lib.rs#L29

@peterwht peterwht added low priority nice-to-have not necessary, but would be nice-to-have labels Sep 12, 2024
@evilrobot-01
Copy link
Collaborator

How do you envisage this is done? An enum with variants might be nice, but would still require conversion to a u8 to pass into the func_id expected by the chain extension, which could be implemented via Into<u8>. Would need to ensure no affect on contract size tho...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority nice-to-have not necessary, but would be nice-to-have
Projects
None yet
Development

No branches or pull requests

2 participants