diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 1fdf90d9..c9ee0083 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -336,7 +336,7 @@ impl CeremoniesApi for Api { } async fn get_meetup_time_offset(&self) -> Result> { - self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None) + self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None).await } async fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result { @@ -359,7 +359,7 @@ impl CeremoniesApi for Api { // get stats of every meetup for m in 1..=mcount { let m_location = self.get_meetup_location(&community_ceremony, m).await?.unwrap(); - let time = self.get_meetup_time(m_location, ONE_DAY).unwrap_or(0); + let time = self.get_meetup_time(m_location, ONE_DAY).await.unwrap_or(0); let participants = self.get_meetup_participants(&community_ceremony, m).await?; let mut registrations = vec![]; diff --git a/client/encointer-api-client-extension/src/communities.rs b/client/encointer-api-client-extension/src/communities.rs index 62076f7b..50977ec6 100644 --- a/client/encointer-api-client-extension/src/communities.rs +++ b/client/encointer-api-client-extension/src/communities.rs @@ -10,7 +10,8 @@ impl CommunitiesApi for Api { async fn get_locations(&self, cid: CommunityIdentifier) -> Result> { let locations = self .client() - .request::>("encointer_getLocations", rpc_params![cid])?; + .request::>("encointer_getLocations", rpc_params![cid]) + .await?; Ok(locations) } } diff --git a/client/encointer-api-client-extension/src/scheduler.rs b/client/encointer-api-client-extension/src/scheduler.rs index 74e97f20..8580fed6 100644 --- a/client/encointer-api-client-extension/src/scheduler.rs +++ b/client/encointer-api-client-extension/src/scheduler.rs @@ -11,27 +11,31 @@ pub trait SchedulerApi { impl SchedulerApi for Api { async fn get_current_phase(&self) -> Result { - self.get_storage("EncointerScheduler", "CurrentPhase", None)? + self.get_storage("EncointerScheduler", "CurrentPhase", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get CurrentPhase".into())) } async fn get_next_phase_timestamp(&self) -> Result { - self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None)? + self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get NextPhaseTimestamp".into())) } async fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result { - self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None)? + self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get PhaseDuration".into())) } async fn get_start_of_attesting_phase(&self) -> Result { - let next_phase_timestamp = self.get_next_phase_timestamp()?; + let next_phase_timestamp = self.get_next_phase_timestamp().await?; - match self.get_current_phase()? { + match self.get_current_phase().await? { CeremonyPhaseType::Assigning => Ok(next_phase_timestamp), // - next_phase_timestamp.rem(ONE_DAY), CeremonyPhaseType::Attesting => { self.get_phase_duration(CeremonyPhaseType::Attesting) + .await .map(|dur| next_phase_timestamp - dur) //- next_phase_timestamp.rem(ONE_DAY) }, CeremonyPhaseType::Registering => Err(ApiClientError::Other(