Add Query endpoints for calculating rewards (#1152)

This commit is contained in:
Drazen Urch
2022-03-18 15:44:26 +01:00
committed by GitHub
parent f24d6e224d
commit 63dd26ca1b
11 changed files with 154 additions and 5 deletions
+27
View File
@@ -140,6 +140,33 @@ impl<C> Client<C> {
self.0.read().await.get_contract_settings().await
}
#[allow(dead_code)]
pub(crate) async fn get_operator_rewards(
&self,
address: String,
) -> Result<u128, ValidatorClientError>
where
C: CosmWasmClient + Sync,
{
self.0.read().await.get_operator_rewards(address).await
}
#[allow(dead_code)]
pub(crate) async fn get_delegator_rewards(
&self,
address: String,
mix_identity: IdentityKey,
) -> Result<u128, ValidatorClientError>
where
C: CosmWasmClient + Sync,
{
self.0
.read()
.await
.get_delegator_rewards(address, mix_identity)
.await
}
pub(crate) async fn get_current_epoch(&self) -> Result<Option<Interval>, ValidatorClientError>
where
C: CosmWasmClient + Sync,