mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Implement HTTP request in offchain workers (#3461)
* Implement HTTP request in offchain workers
* Bump impl_version
* Don't compile offchain workers for WASM anymore
* Initialize HttpConnector as a fallback.
* Apply review suggestions 😳
This commit is contained in:
committed by
Gavin Wood
parent
986876e174
commit
7df089241c
@@ -224,7 +224,7 @@ pub enum Error {
|
||||
/// Deadline has been reached.
|
||||
DeadlineReached,
|
||||
/// Request had timed out.
|
||||
Timeout,
|
||||
IoError,
|
||||
/// Unknown error has been ecountered.
|
||||
Unknown,
|
||||
}
|
||||
@@ -283,8 +283,8 @@ impl PendingRequest {
|
||||
.zip(requests.into_iter())
|
||||
.map(|(status, req)| match status {
|
||||
RequestStatus::DeadlineReached => Err(req),
|
||||
RequestStatus::Timeout => Ok(Err(Error::Timeout)),
|
||||
RequestStatus::Unknown => Ok(Err(Error::Unknown)),
|
||||
RequestStatus::IoError => Ok(Err(Error::IoError)),
|
||||
RequestStatus::Invalid => Ok(Err(Error::Unknown)),
|
||||
RequestStatus::Finished(code) => Ok(Ok(Response::new(req.id, code))),
|
||||
})
|
||||
.collect()
|
||||
|
||||
Reference in New Issue
Block a user