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

ShdwDriveResponse causes parsing errors #19

Open
dboures opened this issue Jul 30, 2022 · 0 comments
Open

ShdwDriveResponse causes parsing errors #19

dboures opened this issue Jul 30, 2022 · 0 comments
Assignees

Comments

@dboures
Copy link
Collaborator

dboures commented Jul 30, 2022

While testing the add_immutable_storage method, I noticed that the parsing of ShdwDriveResponse was causing Rust to panic. For example: ReqwestError(reqwest::Error { kind: Decode, source: Error("missing field txid", line: 1, column: 231) })'
https://github.com/VegetarianOrc/shadow-drive-rust/blob/a4cb2acb24fa8185906db8540fb0e38445ff71ef/src/models.rs#L24-L26

In V1.5 different SHDW endpoints tend to have different fields in their responses (txid is largely missing). See /add-storage in https://shdw.genesysgo.com/using-shadow-drive/the-shadow-drive-platform/shadow-drive-api for example.

I'm not sure what the best solution is, perhaps to have a different response struct for each endpoint? Then we could refactor send_shdw_txn to have a response type associated with it? send_shdw_txn<AddStorageResponse> for example.

@dboures dboures changed the title ShdwDriveResponse causes errors ShdwDriveResponse causes parsing errors Jul 30, 2022
@dboures dboures self-assigned this Jul 31, 2022
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

1 participant