rpc: get_feature_activation_slot should not error for inactive features (#32778)
This commit is contained in:
parent
85a9ebc0af
commit
eae455c34b
|
@ -4029,15 +4029,22 @@ impl RpcClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_feature_activation_slot(&self, feature_id: &Pubkey) -> ClientResult<Option<Slot>> {
|
pub fn get_feature_activation_slot(&self, feature_id: &Pubkey) -> ClientResult<Option<Slot>> {
|
||||||
self.get_account(feature_id)
|
self.get_account_with_commitment(feature_id, self.commitment())
|
||||||
.and_then(|feature_account| {
|
.and_then(|maybe_feature_account| {
|
||||||
bincode::deserialize(feature_account.data()).map_err(|_| {
|
maybe_feature_account
|
||||||
ClientError::from(ErrorKind::Custom(
|
.value
|
||||||
"Failed to deserialize feature account".to_string(),
|
.map(|feature_account| {
|
||||||
))
|
bincode::deserialize(feature_account.data()).map_err(|_| {
|
||||||
})
|
ClientError::from(ErrorKind::Custom(
|
||||||
|
"Failed to deserialize feature account".to_string(),
|
||||||
|
))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.transpose()
|
||||||
|
})
|
||||||
|
.map(|maybe_feature: Option<Feature>| {
|
||||||
|
maybe_feature.and_then(|feature| feature.activated_at)
|
||||||
})
|
})
|
||||||
.map(|feature: Feature| feature.activated_at)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn invoke<T, F: std::future::Future<Output = ClientResult<T>>>(&self, f: F) -> ClientResult<T> {
|
fn invoke<T, F: std::future::Future<Output = ClientResult<T>>>(&self, f: F) -> ClientResult<T> {
|
||||||
|
|
Loading…
Reference in New Issue