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

[fortuna] Support multiple random value encodings #1129

Merged
merged 1 commit into from
Nov 1, 2023
Merged

[fortuna] Support multiple random value encodings #1129

merged 1 commit into from
Nov 1, 2023

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented Nov 1, 2023

Per the API design guidelines, add support for multiple binary encodings to fortuna. This PR makes the endpoint take a ?encoding= query parameter. Binary values are returned as a json object of the form: { encoding: "hex", data: "123ab" }

(this is a nice-to-have, but I think it's going to save us a lot of questions from users of the form "how do i convert this array to a hex string")

Copy link

vercel bot commented Nov 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Nov 1, 2023 5:22pm
xc-admin-frontend ⬜️ Ignored (Inspect) Nov 1, 2023 5:22pm

}
}

pub fn data(&self) -> &[u8; 32] {
Copy link
Contributor Author

@jayantk jayantk Nov 1, 2023

Choose a reason for hiding this comment

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

i don't love that i need to write all this code here to specify that every variant has the same data field -- is there a better way to do this?

@jayantk jayantk merged commit 46b597e into main Nov 1, 2023
5 checks passed
@jayantk jayantk deleted the random15 branch November 1, 2023 19:40
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