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

gofumpt to reduce total number of changes versus v5 #1734

Merged
merged 15 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 0 additions & 1 deletion .github/scripts/build_test_matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func getGithubActionMatrixForTests(e2eRootDirectory string) (GithubActionTestMat

return nil
})

if err != nil {
return GithubActionTestMatrix{}, err
}
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/build_test_matrix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func assertGithubActionTestMatricesEqual(t *testing.T, expected, actual GithubAc
}

func goTestFileContents(suiteName, fnName1, fnName2 string) string {

replacedSuiteName := strings.ReplaceAll(`package foo

func TestSuiteName(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This configuration file was automatically generated by Gitpod.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand why this is useful? I'm not familiar with Gitpod

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no I am sorry!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so 1 bad thing about gitpod:

It puts these in repos automatically.

So I guess not seeing them in unrelated PR's could be a good reason to do it, but that's not really a good reason. Let me get into an actual good reason, after deleting this file.

# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.

tasks:
- init: go get && go build ./... && go test ./... && make
command: go run


4 changes: 2 additions & 2 deletions e2e/fee_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ type FeeMiddlewareTestSuite struct {

// RegisterCounterPartyPayee broadcasts a MsgRegisterCounterpartyPayee message.
func (s *FeeMiddlewareTestSuite) RegisterCounterPartyPayee(ctx context.Context, chain *cosmos.CosmosChain,
user broadcast.User, portID, channelID, relayerAddr, counterpartyPayeeAddr string) (sdk.TxResponse, error) {
user broadcast.User, portID, channelID, relayerAddr, counterpartyPayeeAddr string,
) (sdk.TxResponse, error) {
msg := feetypes.NewMsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayeeAddr)
return s.BroadcastMessages(ctx, chain, user, msg)
}
Expand All @@ -42,7 +43,6 @@ func (s *FeeMiddlewareTestSuite) QueryCounterPartyPayee(ctx context.Context, cha
ChannelId: channelID,
Relayer: relayerAddress,
})

if err != nil {
return "", err
}
Expand Down
5 changes: 2 additions & 3 deletions modules/apps/29-fee/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,8 @@ func (im IBCMiddleware) OnAcknowledgementPacket(
if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) {
return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer)
}

var ack = &types.IncentivizedAcknowledgement{}
if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, ack); err != nil {
var ack types.IncentivizedAcknowledgement
if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil {
return sdkerrors.Wrapf(err, "cannot unmarshal ICS-29 incentivized packet acknowledgement: %v", ack)
}

Expand Down
4 changes: 1 addition & 3 deletions modules/apps/29-fee/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import (
)

func (suite *KeeperTestSuite) TestRegisterPayee() {
var (
msg *types.MsgRegisterPayee
)
var msg *types.MsgRegisterPayee

testCases := []struct {
name string
Expand Down
4 changes: 1 addition & 3 deletions modules/apps/transfer/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() {
}

func (suite *KeeperTestSuite) TestEscrowAddress() {
var (
req *types.QueryEscrowAddressRequest
)
var req *types.QueryEscrowAddressRequest

testCases := []struct {
msg string
Expand Down
1 change: 0 additions & 1 deletion modules/apps/transfer/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func NewMigrator(keeper Keeper) Migrator {

// MigrateTraces migrates the DenomTraces to the correct format, accounting for slashes in the BaseDenom.
func (m Migrator) MigrateTraces(ctx sdk.Context) error {

// list of traces that must replace the old traces in store
var newTraces []types.DenomTrace
m.keeper.IterateDenomTraces(ctx,
Expand Down
2 changes: 0 additions & 2 deletions modules/apps/transfer/keeper/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import (
)

func (suite *KeeperTestSuite) TestMigratorMigrateTraces() {

testCases := []struct {
msg string
malleate func()
expectedTraces transfertypes.Traces
}{

{
"success: two slashes in base denom",
func() {
Expand Down
1 change: 0 additions & 1 deletion modules/core/02-client/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ func (q Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsens
consensusStateHeights = append(consensusStateHeights, height)
return true, nil
})

if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion modules/core/03-connection/keeper/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (k Keeper) ConnOpenTry(
proofHeight exported.Height, // height at which relayer constructs proof of A storing connectionEnd in state
consensusHeight exported.Height, // latest height of chain B which chain A has stored in its chain B client
) (string, error) {

// generate a new connection
connectionID := k.GenerateConnectionIdentifier(ctx)

Expand Down