From bbc7b4c198ef076cc000465e5c751c1758ee3239 Mon Sep 17 00:00:00 2001 From: bmo Date: Tue, 10 Dec 2024 09:50:25 +0200 Subject: [PATCH 1/2] chore: uses errors.New (#7653) --- modules/apps/transfer/keeper/keeper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/apps/transfer/keeper/keeper.go b/modules/apps/transfer/keeper/keeper.go index 1ebb14ace71..d3d49564cc3 100644 --- a/modules/apps/transfer/keeper/keeper.go +++ b/modules/apps/transfer/keeper/keeper.go @@ -359,7 +359,7 @@ 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)) @@ -367,10 +367,10 @@ func (k Keeper) iterateForwardedPackets(ctx context.Context, cb func(packet type 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])) From 30352fb1b240580b0211aec58da4da857bf17b42 Mon Sep 17 00:00:00 2001 From: soonsouth <163404563+soonsouth@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:05:58 +0800 Subject: [PATCH 2/2] chore: fix some function names in comment (#7651) * chore: fix some function names in comment Signed-off-by: soonsouth * Update modules/light-clients/08-wasm/internal/types/store.go --------- Signed-off-by: soonsouth Co-authored-by: DimitrisJim --- modules/core/04-channel/keeper/keeper_test.go | 2 +- modules/light-clients/08-wasm/internal/types/store.go | 2 +- modules/light-clients/08-wasm/keeper/keeper.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/04-channel/keeper/keeper_test.go b/modules/core/04-channel/keeper/keeper_test.go index c6014805af6..ef264410d19 100644 --- a/modules/core/04-channel/keeper/keeper_test.go +++ b/modules/core/04-channel/keeper/keeper_test.go @@ -915,7 +915,7 @@ func (suite *KeeperTestSuite) UpgradeChannel(path *ibctesting.Path, upgradeField suite.Require().NoError(err) } -// sendMockPacket sends a packet from source to dest and acknowledges it on the source (completing the packet lifecycle) +// sendMockPackets sends a packet from source to dest and acknowledges it on the source (completing the packet lifecycle) // if acknowledge is true. If acknowledge is false, then the packet will be sent, but timed out. // Question(jim): find a nicer home for this? func (suite *KeeperTestSuite) sendMockPackets(path *ibctesting.Path, numPackets int, acknowledge bool) { diff --git a/modules/light-clients/08-wasm/internal/types/store.go b/modules/light-clients/08-wasm/internal/types/store.go index 11ffd559d94..c29789c3ca2 100644 --- a/modules/light-clients/08-wasm/internal/types/store.go +++ b/modules/light-clients/08-wasm/internal/types/store.go @@ -151,7 +151,7 @@ func (s ClientRecoveryStore) CacheWrapWithTrace(w io.Writer, tc storetypes.Trace return cachekv.NewStore(tracekv.NewStore(s, w, tc)) } -// getStore returns the types to be used for the given key and a boolean flag indicating if that types was found. +// GetStore returns the types to be used for the given key and a boolean flag indicating if that type was found. // If the key is prefixed with "subject/", the subjectStore is returned. If the key is prefixed with "substitute/", // the substituteStore is returned. // diff --git a/modules/light-clients/08-wasm/keeper/keeper.go b/modules/light-clients/08-wasm/keeper/keeper.go index 0e2d8f1b8bd..5e05a7a44c4 100644 --- a/modules/light-clients/08-wasm/keeper/keeper.go +++ b/modules/light-clients/08-wasm/keeper/keeper.go @@ -72,7 +72,7 @@ func (k Keeper) getQueryPlugins() QueryPlugins { return k.queryPlugins } -// SetQueryPlugins sets the plugins. +// setQueryPlugins sets the plugins. func (k *Keeper) setQueryPlugins(plugins QueryPlugins) { k.queryPlugins = plugins }