Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Feb 12, 2024
1 parent 71a9f17 commit 4ca58a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x/tokenfactory/bindings/custom_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ type ReflectSubMsgs struct {
}

func executeCustom(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, contract sdk.AccAddress, sender sdk.AccAddress, msg bindings.TokenFactoryMsg, funds sdk.Coin) error { //nolint:unparam // funds is always nil but could change in the future.
t.Helper()

customBz, err := json.Marshal(msg)
require.NoError(t, err)

Expand Down
2 changes: 2 additions & 0 deletions x/tokenfactory/bindings/custom_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type ChainResponse struct {
}

func queryCustom(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, contract sdk.AccAddress, request bindings.TokenFactoryQuery, response interface{}) {
t.Helper()

msgBz, err := json.Marshal(request)
require.NoError(t, err)
fmt.Println("queryCustom1", string(msgBz))
Expand Down
12 changes: 12 additions & 0 deletions x/tokenfactory/bindings/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ import (
)

func CreateTestInput(t *testing.T) (*app.OmniFlixApp, sdk.Context) {
t.Helper()

omniflix := app.Setup(t)
ctx := omniflix.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "testing", Time: time.Now().UTC()})
return omniflix, ctx
}

func FundAccount(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, acct sdk.AccAddress) {
t.Helper()

err := banktestutil.FundAccount(customApp.AppKeepers.BankKeeper, ctx, acct, sdk.NewCoins(
sdk.NewCoin("uflix", sdk.NewInt(10000000000)),
))
Expand All @@ -49,6 +53,8 @@ func RandomBech32AccountAddress() string {
}

func storeReflectCode(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, addr sdk.AccAddress) uint64 {
t.Helper()

wasmCode, err := os.ReadFile("./testdata/token_reflect.wasm")
require.NoError(t, err)

Expand All @@ -60,6 +66,8 @@ func storeReflectCode(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp,
}

func instantiateReflectContract(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, funder sdk.AccAddress) sdk.AccAddress {
t.Helper()

initMsgBz := []byte("{}")
contractKeeper := keeper.NewDefaultPermissionKeeper(customApp.AppKeepers.WasmKeeper)
codeID := uint64(1)
Expand All @@ -70,6 +78,8 @@ func instantiateReflectContract(t *testing.T, ctx sdk.Context, customApp *app.Om
}

func fundAccount(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, addr sdk.AccAddress, coins sdk.Coins) {
t.Helper()

err := banktestutil.FundAccount(
customApp.AppKeepers.BankKeeper,
ctx,
Expand All @@ -80,6 +90,8 @@ func fundAccount(t *testing.T, ctx sdk.Context, customApp *app.OmniFlixApp, addr
}

func SetupCustomApp(t *testing.T, addr sdk.AccAddress) (*app.OmniFlixApp, sdk.Context) {
t.Helper()

customApp, ctx := CreateTestInput(t)
wasmKeeper := customApp.AppKeepers.WasmKeeper

Expand Down

0 comments on commit 4ca58a4

Please sign in to comment.