Skip to content

Commit

Permalink
Make TransactionKind::is_system_tx an exhaustive match (MystenLabs#15349
Browse files Browse the repository at this point in the history
)
  • Loading branch information
aschran authored Dec 13, 2023
1 parent 54ae36a commit 068e3c6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions crates/sui-types/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,16 +1102,17 @@ impl TransactionKind {
}

pub fn is_system_tx(&self) -> bool {
matches!(
self,
// Keep this as an exhaustive match so that we can't forget to update it.
match self {
TransactionKind::ChangeEpoch(_)
| TransactionKind::Genesis(_)
| TransactionKind::ConsensusCommitPrologue(_)
| TransactionKind::ConsensusCommitPrologueV2(_)
| TransactionKind::AuthenticatorStateUpdate(_)
| TransactionKind::RandomnessStateUpdate(_)
| TransactionKind::EndOfEpochTransaction(_)
)
| TransactionKind::Genesis(_)
| TransactionKind::ConsensusCommitPrologue(_)
| TransactionKind::ConsensusCommitPrologueV2(_)
| TransactionKind::AuthenticatorStateUpdate(_)
| TransactionKind::RandomnessStateUpdate(_)
| TransactionKind::EndOfEpochTransaction(_) => true,
TransactionKind::ProgrammableTransaction(_) => false,
}
}

pub fn is_end_of_epoch_tx(&self) -> bool {
Expand Down

0 comments on commit 068e3c6

Please sign in to comment.