diff --git a/contracts/provider/external-staking/src/crdt.rs b/contracts/provider/external-staking/src/crdt.rs
index b1c43f50..5ae2f7fe 100644
--- a/contracts/provider/external-staking/src/crdt.rs
+++ b/contracts/provider/external-staking/src/crdt.rs
@@ -28,6 +28,10 @@ impl ActiveState {
self.0.sort_by(|a, b| b.start_height.cmp(&a.start_height));
self.0.dedup();
}
+
+ pub fn query_at_height(&self, height: u64) -> Option<&ValUpdate> {
+ self.0.iter().find(|u| u.start_height <= height)
+ }
}
#[cw_serde]
@@ -124,6 +128,31 @@ impl<'a> CrdtState<'a> {
.take(limit)
.collect()
}
+
+ pub fn active_validator(
+ &self,
+ storage: &dyn Storage,
+ valoper: &str,
+ ) -> StdResult