Skip to content

Commit

Permalink
fix status filtering
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Jan 2, 2025
1 parent c4df52a commit 95d008b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mm2src/coins/rpc_command/tendermint/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ pub type ValidatorsRPCResult = Result<ValidatorsRPCResponse, MmError<ValidatorsR
pub enum ValidatorStatus {
All,
#[default]
Active,
Jailed,
Bonded,
Unbonded,
}

impl ToString for ValidatorStatus {
fn to_string(&self) -> String {
match self {
ValidatorStatus::All => "".into(),
ValidatorStatus::Active => "Bonded".into(),
ValidatorStatus::Jailed => "Unbonded".into(),
ValidatorStatus::All => String::default(),
ValidatorStatus::Bonded => "BOND_STATUS_BONDED".into(),
ValidatorStatus::Unbonded => "BOND_STATUS_UNBONDED".into(),
}
}
}

#[derive(Deserialize)]
pub struct ValidatorsRPC {
#[serde(rename = "ticker")]
coin: String,
#[serde(flatten)]
paging: PagingOptions,
Expand Down

0 comments on commit 95d008b

Please sign in to comment.