Skip to content

Commit

Permalink
staking: fix updated proto conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Jan 29, 2024
1 parent 2d90052 commit 564c28f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/core/component/stake/src/validator/bonding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl From<State> for pb::BondingState {
State::Unbonded => pb::bonding_state::BondingStateEnum::Unbonded as i32,
State::Unbonding { .. } => pb::bonding_state::BondingStateEnum::Unbonding as i32,
},
unbonding_epoch: match v {
unbonds_at_epoch: match v {
State::Unbonding { unbonds_at_epoch } => unbonds_at_epoch,
_ => 0,
},
Expand All @@ -66,8 +66,8 @@ impl TryFrom<pb::BondingState> for State {
pb::bonding_state::BondingStateEnum::Bonded => Ok(State::Bonded),
pb::bonding_state::BondingStateEnum::Unbonded => Ok(State::Unbonded),
pb::bonding_state::BondingStateEnum::Unbonding => {
let unbonding_epoch = if v.unbonding_epoch > 0 {
v.unbonding_epoch
let unbonds_at_epoch = if v.unbonds_at_epoch > 0 {
v.unbonds_at_epoch
} else {
anyhow::bail!("unbonding epoch should be set for unbonding state")
};
Expand Down

0 comments on commit 564c28f

Please sign in to comment.