Skip to content

ShdwDriveResponse causes parsing errors #19

@dboures

Description

@dboures

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions