Skip to content

Commit

Permalink
Filter certain error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell committed Aug 13, 2024
1 parent 3c8caf8 commit 6397079
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions keepers/validator-keeper/src/operations/steward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ pub enum StewardErrorCodes {
InvalidState = 0xA2, // Don't Raise Flag
IndexesDontMatch = 0xA3, // Raise Flag
VoteHistoryNotRecentEnough = 0xA4, // Don't Raise Flag
AutoRemoveStakeAccountClosed = 0xA5, // Don't Raise Flag
StakePoolNotUpdated = 0xA6, // Don't Raise Flag
ValidatorsNotRemovedYet = 0xA7, // Don't Raise Flag
}

pub async fn fire(
Expand Down Expand Up @@ -81,6 +84,21 @@ pub async fn fire(
keeper_flags.set_flag(KeeperFlag::RerunVote);
StewardErrorCodes::VoteHistoryNotRecentEnough as i64
}
s if s.contains("AutoRemoveValidatorFromPool")
&& s.contains("ConstraintOwner") =>
{
StewardErrorCodes::AutoRemoveStakeAccountClosed as i64
}
s if s.contains("UpdateStakePoolBalance")
&& s.contains("0x10") =>
{
StewardErrorCodes::StakePoolNotUpdated as i64
}
s if s.contains("AutoAddValidator")
&& s.contains("ValidatorsNeedToBeRemoved") =>
{
StewardErrorCodes::ValidatorsNotRemovedYet as i64
}
_ => {
StewardErrorCodes::UnknownRpcSimulateTransactionResult
as i64
Expand Down

0 comments on commit 6397079

Please sign in to comment.