Skip to content

Commit

Permalink
Rephrase panic message
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Mar 11, 2024
1 parent 09676f0 commit 9c46f17
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions input_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tpkg/rand_unlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down
10 changes: 5 additions & 5 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down Expand Up @@ -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")
}
}

Expand All @@ -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")
}
}

Expand All @@ -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")
}
}

Expand All @@ -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")
}
}

Expand Down
4 changes: 2 additions & 2 deletions unlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{}
Expand All @@ -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
Expand Down

0 comments on commit 9c46f17

Please sign in to comment.