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

refactor: use typed Trace #6432

Merged
merged 12 commits into from
May 30, 2024
2 changes: 1 addition & 1 deletion modules/apps/transfer/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() {
{
Denom: types.Denom{
Base: ibctesting.TestCoin.Denom,
Trace: []types.Trace{types.Trace{}},
Trace: []types.Trace{{}},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find this to be an odd linting standard

},
Amount: ibctesting.TestCoin.Amount.String(),
},
Expand Down
10 changes: 6 additions & 4 deletions modules/apps/transfer/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ func (suite *KeeperTestSuite) TestQueryDenom() {
Trace: []types.Trace{
types.NewTrace("transfer", "channelToA"), //nolint:goconst
types.NewTrace("transfer", "channelToB"), //nolint:goconst
}}
},
}
suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), expDenom)

req = &types.QueryDenomRequest{
Expand All @@ -48,8 +49,8 @@ func (suite *KeeperTestSuite) TestQueryDenom() {
Trace: []types.Trace{
types.NewTrace("transfer", "channelToA"), //nolint:goconst
types.NewTrace("transfer", "channelToB"), //nolint:goconst
}}

},
}
suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), expDenom)

req = &types.QueryDenomRequest{
Expand All @@ -75,7 +76,8 @@ func (suite *KeeperTestSuite) TestQueryDenom() {
Trace: []types.Trace{
types.NewTrace("transfer", "channelToA"), //nolint:goconst
types.NewTrace("transfer", "channelToB"), //nolint:goconst
}}
},
}

req = &types.QueryDenomRequest{
Hash: expDenom.IBCDenom(),
Expand Down
10 changes: 1 addition & 9 deletions modules/apps/transfer/types/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@ import (
"testing"

"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
)

const (
denom = "atom/pool"
amount = "100"
)

var (
sender = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String()
receiver = sdk.AccAddress("testaddr2").String()
)

func TestValidate(t *testing.T) {
testCases := []struct {
name string
Expand Down Expand Up @@ -137,7 +129,7 @@ func TestValidate(t *testing.T) {
Token{
Denom: Denom{
Base: "uatom",
Trace: []Trace{Trace{}},
Trace: []Trace{{}},
},
Amount: amount,
},
Expand Down