Open dboures opened 2 years ago
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
add_immutable_storage
ShdwDriveResponse
txid
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.
send_shdw_txn
send_shdw_txn<AddStorageResponse>
While testing the
add_immutable_storage
method, I noticed that the parsing ofShdwDriveResponse
was causing Rust to panic. For example: ReqwestError(reqwest::Error { kind: Decode, source: Error("missing fieldtxid
", line: 1, column: 231) })' https://github.com/VegetarianOrc/shadow-drive-rust/blob/a4cb2acb24fa8185906db8540fb0e38445ff71ef/src/models.rs#L24-L26In 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.