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

fumpt #1335

Merged
merged 6 commits into from
May 24, 2022
Merged

fumpt #1335

Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### State Machine Breaking

### Improvements

* (cleanup) [\#1335](https://github.com/cosmos/ibc-go/pull/1335/) `gofumpt -w -l .` to standardize the code layout more strictly than `go fmt ./...`
* (transfer) [\#1342](https://github.com/cosmos/ibc-go/pull/1342) `DenomTrace` grpc now takes in either an `ibc denom` or a `hash` instead of only accepting a `hash`.
* (modules/core/keeper) [\#1284](https://github.com/cosmos/ibc-go/pull/1284) Add sanity check for the keepers passed into `ibckeeper.NewKeeper`. `ibckeeper.NewKeeper` now panics if any of the keepers passed in is empty.
* (middleware) [\#1022](https://github.com/cosmos/ibc-go/pull/1022) Add `GetAppVersion` to the ICS4Wrapper interface. This function should be used by IBC applications to obtain their own version since the version set in the channel structure may be wrapped many times by middleware.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ func SetupICAPath(path *ibctesting.Path, owner string) error {
}

func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
var (
channel *channeltypes.Channel
)
var channel *channeltypes.Channel

testCases := []struct {
name string
Expand Down Expand Up @@ -273,9 +271,7 @@ func (suite *InterchainAccountsTestSuite) TestChanOpenTry() {
}

func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
name string
Expand Down Expand Up @@ -336,10 +332,8 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() {
} else {
suite.Require().Error(err)
}

})
}

}

// Test initiating a ChanOpenConfirm using the controller chain instead of the host chain
Expand Down Expand Up @@ -389,7 +383,6 @@ func (suite *InterchainAccountsTestSuite) TestChanOpenConfirm() {
suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID,
)
suite.Require().Error(err)

}

// OnChanCloseInit on controller (chainA)
Expand All @@ -414,16 +407,13 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseInit() {
}

func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
name string
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand Down Expand Up @@ -454,13 +444,11 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {
} else {
suite.Require().Error(err)
}

})
}
}

func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {

testCases := []struct {
name string
malleate func()
Expand Down Expand Up @@ -509,9 +497,7 @@ func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {
}

func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
msg string
Expand Down Expand Up @@ -580,9 +566,7 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {
}

func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
msg string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// RegisterInterchainAccount is the entry point to registering an interchain account.
// It generates a new port identifier using the owner address. It will bind to the
// It generates a new port identifier using the owner address. It will bind to the
// port identifier and call 04-channel 'ChanOpenInit'. An error is returned if the port
// identifier is already in use. Gaining access to interchain accounts whose channels
// have closed cannot be done with this function. A regular MsgChanOpenInit must be used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (suite *KeeperTestSuite) TestInitGenesis() {
expParams := types.NewParams(false)
params := suite.chainA.GetSimApp().ICAControllerKeeper.GetParams(suite.chainA.GetContext())
suite.Require().Equal(expParams, params)

}

func (suite *KeeperTestSuite) TestExportGenesis() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,5 @@ func (k Keeper) OnChanCloseConfirm(
portID,
channelID string,
) error {

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func (suite *KeeperTestSuite) TestOnChanOpenInit() {
malleate func()
expPass bool
}{

{
"success",
func() {
Expand Down Expand Up @@ -242,7 +241,6 @@ func (suite *KeeperTestSuite) TestOnChanOpenInit() {
} else {
suite.Require().Error(err)
}

})
}
}
Expand Down Expand Up @@ -402,16 +400,13 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() {
}

func (suite *KeeperTestSuite) TestOnChanCloseConfirm() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
name string
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand Down Expand Up @@ -441,7 +436,6 @@ func (suite *KeeperTestSuite) TestOnChanCloseConfirm() {
} else {
suite.Require().Error(err)
}

})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func NewKeeper(
ics4Wrapper icatypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper,
scopedKeeper capabilitykeeper.ScopedKeeper, msgRouter *baseapp.MsgServiceRouter,
) Keeper {

// set KeyTable if it has not already been set
if !paramSpace.HasKeyTable() {
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
}

func (suite *KeeperTestSuite) TestOnTimeoutPacket() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
msg string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ const (
DefaultControllerEnabled = true
)

var (
// KeyControllerEnabled is the store key for ControllerEnabled Params
KeyControllerEnabled = []byte("ControllerEnabled")
)
// KeyControllerEnabled is the store key for ControllerEnabled Params
var KeyControllerEnabled = []byte("ControllerEnabled")

// ParamKeyTable type declaration for parameters
func ParamKeyTable() paramtypes.KeyTable {
Expand Down
22 changes: 2 additions & 20 deletions modules/apps/27-interchain-accounts/host/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() {
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand All @@ -165,7 +164,6 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() {
) (string, error) {
return "", fmt.Errorf("mock ica auth fails")
}

}, true,
},
{
Expand Down Expand Up @@ -222,10 +220,8 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() {
suite.Require().Error(err)
suite.Require().Equal("", version)
}

})
}

}

// Test initiating a ChanOpenAck using the host chain instead of the controller chain
Expand Down Expand Up @@ -268,7 +264,6 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenConfirm() {
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand All @@ -285,7 +280,6 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenConfirm() {
) error {
return fmt.Errorf("mock ica auth fails")
}

}, true,
},
}
Expand Down Expand Up @@ -322,10 +316,8 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenConfirm() {
} else {
suite.Require().Error(err)
}

})
}

}

// OnChanCloseInit on host (chainB)
Expand All @@ -350,16 +342,13 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseInit() {
}

func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
name string
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand Down Expand Up @@ -390,15 +379,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {
} else {
suite.Require().Error(err)
}

})
}
}

func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {
var (
packetData []byte
)
var packetData []byte
testCases := []struct {
name string
malleate func()
Expand Down Expand Up @@ -502,14 +488,11 @@ func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {
} else {
suite.Require().False(ack.Success())
}

})
}

}

func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {

testCases := []struct {
name string
malleate func()
Expand Down Expand Up @@ -563,7 +546,6 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {
}

func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {

testCases := []struct {
name string
malleate func()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount() {
path := NewICAPath(suite.chainA, suite.chainB)
suite.coordinator.SetupConnections(path)

//RegisterInterchainAccount
// RegisterInterchainAccount
err := SetupICAPath(path, TestOwnerAddress)
suite.Require().NoError(err)

Expand Down
4 changes: 2 additions & 2 deletions modules/apps/27-interchain-accounts/host/keeper/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/cosmos/ibc-go/v3/modules/core/exported"

icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
"github.com/cosmos/ibc-go/v3/modules/core/exported"
)

// EmitWriteErrorAcknowledgementEvent emits an event signalling an error acknowledgement and including the error details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,5 @@ func (k Keeper) OnChanCloseConfirm(
portID,
channelID string,
) error {

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() {
malleate func()
expPass bool
}{

{
"success",
func() {
Expand Down Expand Up @@ -228,16 +227,13 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() {
}

func (suite *KeeperTestSuite) TestOnChanOpenConfirm() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
name string
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand Down Expand Up @@ -279,22 +275,18 @@ func (suite *KeeperTestSuite) TestOnChanOpenConfirm() {
} else {
suite.Require().Error(err)
}

})
}
}

func (suite *KeeperTestSuite) TestOnChanCloseConfirm() {
var (
path *ibctesting.Path
)
var path *ibctesting.Path

testCases := []struct {
name string
malleate func()
expPass bool
}{

{
"success", func() {}, true,
},
Expand All @@ -320,7 +312,6 @@ func (suite *KeeperTestSuite) TestOnChanCloseConfirm() {
} else {
suite.Require().Error(err)
}

})
}
}
Loading