Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: uses errors.New #7653

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/apps/transfer/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,18 @@ func (k Keeper) iterateForwardedPackets(ctx context.Context, cb func(packet type
// Iterator key consists of types.ForwardedPacketKey/portID/channelID/sequence
parts := strings.Split(string(iterator.Key()), "/")
if len(parts) != 4 {
panic(fmt.Errorf("key path should always have 4 elements"))
panic(errors.New("key path should always have 4 elements"))
}
if parts[0] != string(types.ForwardedPacketKey) {
panic(fmt.Errorf("key path does not start with expected prefix: %s", types.ForwardedPacketKey))
}

portID, channelID := parts[1], parts[2]
if err := host.PortIdentifierValidator(portID); err != nil {
panic(fmt.Errorf("port identifier validation failed while parsing forward key path"))
panic(errors.New("port identifier validation failed while parsing forward key path"))
}
if err := host.ChannelIdentifierValidator(channelID); err != nil {
panic(fmt.Errorf("channel identifier validation failed while parsing forward key path"))
panic(errors.New("channel identifier validation failed while parsing forward key path"))
}

forwardPacket.ForwardKey.Sequence = sdk.BigEndianToUint64([]byte(parts[3]))
Expand Down
Loading