From 9c46f17ce246e219d637fa55932b7431820ed146 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Mon, 11 Mar 2024 16:46:11 +0800 Subject: [PATCH] Rephrase panic message --- input.go | 4 ++-- input_context.go | 4 ++-- output.go | 6 +++--- tpkg/rand_unlock.go | 2 +- transaction.go | 10 +++++----- unlock.go | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/input.go b/input.go index 6a76f4563..5c01ee426 100644 --- a/input.go +++ b/input.go @@ -94,7 +94,7 @@ func InputsSyntacticalUnique() ElementValidationFunc[Input] { } utxoSet[k] = index default: - panic("all known input types should be handled above") + panic("all supported input types should be handled above") } return nil @@ -111,7 +111,7 @@ func InputsSyntacticalIndicesWithinBounds() ElementValidationFunc[Input] { return ierrors.WithMessagef(ErrRefUTXOIndexInvalid, "input %d", index) } default: - panic("all known input types should be handled above") + panic("all supported input types should be handled above") } return nil diff --git a/input_context.go b/input_context.go index 876ed8bbe..71a962489 100644 --- a/input_context.go +++ b/input_context.go @@ -101,7 +101,7 @@ func ContextInputsRewardInputMaxIndex(inputsCount uint16) ElementValidationFunc[ index, utxoIndex, inputsCount) } default: - panic("all known context input types should be handled above") + panic("all supported context input types should be handled above") } return nil @@ -128,7 +128,7 @@ func ContextInputsCommitmentInputRequirement() ElementValidationFunc[ContextInpu return ierrors.WithMessagef(ErrCommitmentInputMissing, "reward input at index %d requires a commitment input", index) } default: - panic("all known context input types should be handled above") + panic("all supported context input types should be handled above") } return nil diff --git a/output.go b/output.go index cbb06b2db..ec5055313 100644 --- a/output.go +++ b/output.go @@ -668,7 +668,7 @@ func OutputsSyntacticalImplicitAccountCreationAddress() ElementValidationFunc[Ou return ierrors.WithMessagef(ErrImplicitAccountCreationAddressInInvalidOutput, "output %d", index) } default: - panic("all known output types should be handled above") + panic("all supported output types should be handled above") } return nil @@ -717,7 +717,7 @@ func OutputsSyntacticalUnlockConditionLexicalOrderAndUniqueness() ElementValidat } } default: - panic("all known output types should be handled above") + panic("all supported output types should be handled above") } return nil @@ -786,7 +786,7 @@ func OutputsSyntacticalFeaturesLexicalOrderAndUniqueness() ElementValidationFunc // This output does not have features. return nil default: - panic("all known output types should be handled above") + panic("all supported output types should be handled above") } return nil diff --git a/tpkg/rand_unlock.go b/tpkg/rand_unlock.go index 1600e4cdc..8e5100662 100644 --- a/tpkg/rand_unlock.go +++ b/tpkg/rand_unlock.go @@ -29,7 +29,7 @@ func RandUnlock(allowEmptyUnlock bool) iotago.Unlock { case iotago.UnlockEmpty: return &iotago.EmptyUnlock{} default: - panic("all known unlock types should be handled above") + panic("all supported unlock types should be handled above") } } diff --git a/transaction.go b/transaction.go index 3373c4658..170c905f2 100644 --- a/transaction.go +++ b/transaction.go @@ -140,7 +140,7 @@ func (t *Transaction) Inputs() ([]*UTXOInput, error) { case *UTXOInput: references = append(references, castInput) default: - panic("all known input types should be handled above") + panic("all supported input types should be handled above") } } @@ -168,7 +168,7 @@ func (t *Transaction) ContextInputs() (TransactionContextInputs, error) { case *CommitmentInput, *BlockIssuanceCreditInput, *RewardInput: references = append(references, castInput) default: - panic("all known context input types should be handled above") + panic("all supported context input types should be handled above") } } @@ -184,7 +184,7 @@ func (t *Transaction) BICInputs() ([]*BlockIssuanceCreditInput, error) { case *CommitmentInput, *RewardInput: // ignore this type default: - panic("all known context input types should be handled above") + panic("all supported context input types should be handled above") } } @@ -200,7 +200,7 @@ func (t *Transaction) RewardInputs() ([]*RewardInput, error) { case *CommitmentInput, *BlockIssuanceCreditInput: // ignore this type default: - panic("all known context input types should be handled above") + panic("all supported context input types should be handled above") } } @@ -216,7 +216,7 @@ func (t *Transaction) CommitmentInput() *CommitmentInput { case *CommitmentInput: return castInput default: - panic("all known context input types should be handled above") + panic("all supported context input types should be handled above") } } diff --git a/unlock.go b/unlock.go index 871c9eff1..fe364b2d5 100644 --- a/unlock.go +++ b/unlock.go @@ -250,7 +250,7 @@ func SignaturesUniqueAndReferenceUnlocksValidator(api API) UnlockValidatorFunc { continue default: - panic("all known unlock types should be handled above") + panic("all supported unlock types should be handled above") } } seenMultiUnlocks[uint16(index)] = struct{}{} @@ -260,7 +260,7 @@ func SignaturesUniqueAndReferenceUnlocksValidator(api API) UnlockValidatorFunc { return ierrors.WithMessagef(ErrEmptyUnlockOutsideMultiUnlock, "unlock at index %d is invalid", index) default: - panic("all known unlock types should be handled above") + panic("all supported unlock types should be handled above") } return nil