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

Go Formatting update #648

Merged
merged 3 commits into from
Oct 21, 2021
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Implemented Enhancements:**

- Remove unused flags from command prompt for storing contract [\#647](https://github.com/CosmWasm/wasmd/issues/647)
- Ran `make format` [\#649](https://github.com/CosmWasm/wasmd/issues/649)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.20.0...HEAD)

Expand Down
3 changes: 2 additions & 1 deletion app/ante.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package app

import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/types"
channelkeeper "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/keeper"
ibcante "github.com/cosmos/cosmos-sdk/x/ibc/core/ante"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)

// NewAnteHandler returns an AnteHandler that checks and increments sequence
Expand Down
5 changes: 3 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/CosmWasm/wasmd/x/wasm"
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/rpc"
Expand Down Expand Up @@ -88,6 +86,9 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/CosmWasm/wasmd/x/wasm"
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
)
Expand Down
3 changes: 2 additions & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"github.com/tendermint/tendermint/libs/log"
db "github.com/tendermint/tm-db"

"github.com/CosmWasm/wasmd/x/wasm"
abci "github.com/tendermint/tendermint/abci/types"

"github.com/CosmWasm/wasmd/x/wasm"
)

var emptyWasmOpts []wasm.Option = nil
Expand Down
10 changes: 6 additions & 4 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ package app
import (
"encoding/json"
"fmt"
"github.com/CosmWasm/wasmd/x/wasm"
"os"
"path/filepath"
"testing"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -26,9 +29,8 @@ import (
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"os"
"path/filepath"
"testing"

"github.com/CosmWasm/wasmd/x/wasm"
)

// Get flags every time the simulator is run
Expand Down
3 changes: 2 additions & 1 deletion app/test_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package app
import (
"testing"

"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/codec"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
ibctransferkeeper "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/keeper"
ibckeeper "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

"github.com/CosmWasm/wasmd/x/wasm"
)

type TestSupport struct {
Expand Down
3 changes: 2 additions & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/CosmWasm/wasmd/x/wasm"
"strconv"
"testing"
"time"

"github.com/CosmWasm/wasmd/x/wasm"

"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
}
initialBalances[i] = balance{
Address: acct,
Amount: 1000000000,
Amount: 1000000000,
}
}
init := cw20InitMsg{
Name: "Cash Money",
Symbol: "CASH",
Decimals: 2,
Name: "Cash Money",
Symbol: "CASH",
Decimals: 2,
InitialBalances: initialBalances,
}
initBz, err := json.Marshal(init)
Expand Down
24 changes: 12 additions & 12 deletions benchmarks/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,27 @@ func BenchmarkTxSending(b *testing.B) {
numAccounts int
}{
"basic send - memdb": {
db: buildMemDB,
blockSize: 20,
txBuilder: buildTxFromMsg(bankSendMsg),
db: buildMemDB,
blockSize: 20,
txBuilder: buildTxFromMsg(bankSendMsg),
numAccounts: 50,
},
"cw20 transfer - memdb": {
db: buildMemDB,
blockSize: 20,
txBuilder: buildTxFromMsg(cw20TransferMsg),
db: buildMemDB,
blockSize: 20,
txBuilder: buildTxFromMsg(cw20TransferMsg),
numAccounts: 50,
},
"basic send - leveldb": {
db: buildLevelDB,
blockSize: 20,
txBuilder: buildTxFromMsg(bankSendMsg),
db: buildLevelDB,
blockSize: 20,
txBuilder: buildTxFromMsg(bankSendMsg),
numAccounts: 50,
},
"cw20 transfer - leveldb": {
db: buildLevelDB,
blockSize: 20,
txBuilder: buildTxFromMsg(cw20TransferMsg),
db: buildLevelDB,
blockSize: 20,
txBuilder: buildTxFromMsg(cw20TransferMsg),
numAccounts: 50,
},
"basic send - leveldb - 8k accounts": {
Expand Down
3 changes: 2 additions & 1 deletion cmd/wasmd/genwasm.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli"
"github.com/cosmos/cosmos-sdk/client"
"github.com/spf13/cobra"

wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli"
)

func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/wasmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package main
import (
"os"

"github.com/CosmWasm/wasmd/app"
"github.com/cosmos/cosmos-sdk/server"

"github.com/CosmWasm/wasmd/app"
)

func main() {
Expand Down
11 changes: 7 additions & 4 deletions cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"os"
"path/filepath"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/prometheus/client_golang/prometheus"

"github.com/CosmWasm/wasmd/x/wasm"
clientcodec "github.com/CosmWasm/wasmd/x/wasm/client/codec"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli"
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
Expand All @@ -20,7 +19,9 @@ import (
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm"
clientcodec "github.com/CosmWasm/wasmd/x/wasm/client/codec"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/debug"
Expand All @@ -38,6 +39,8 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"

"github.com/CosmWasm/wasmd/app"
)

// NewRootCmd creates a new root command for wasmd. It is called once in the
Expand Down
4 changes: 3 additions & 1 deletion x/wasm/client/cli/genesis_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"encoding/json"
"errors"
"fmt"

"github.com/CosmWasm/wasmd/x/wasm/keeper"

"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand All @@ -23,6 +23,8 @@ import (
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/crypto"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/CosmWasm/wasmd/x/wasm/types"
)

// GenesisReader reads genesis data. Extension point for custom genesis state readers.
Expand Down
5 changes: 3 additions & 2 deletions x/wasm/client/cli/genesis_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"path"
"testing"

"github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/hd"
Expand All @@ -28,6 +26,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/CosmWasm/wasmd/x/wasm/types"
)

var wasmIdent = []byte("\x00\x61\x73\x6D")
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/cli/gov_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package cli
import (
"fmt"

"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/client/cli"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/CosmWasm/wasmd/x/wasm/types"
)

func ProposalStoreCodeCmd() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/cli/new_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package cli
import (
"strconv"

"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/spf13/cobra"

"github.com/CosmWasm/wasmd/x/wasm/types"
)

// MigrateContractCmd will migrate a contract to a new code version
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import (
"io/ioutil"
"strconv"

"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"

"github.com/CosmWasm/wasmd/x/wasm/types"
)

func GetQueryCmd() *cobra.Command {
Expand Down
5 changes: 3 additions & 2 deletions x/wasm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import (
"io/ioutil"
"strconv"

wasmUtils "github.com/CosmWasm/wasmd/x/wasm/client/utils"
"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"

wasmUtils "github.com/CosmWasm/wasmd/x/wasm/client/utils"
"github.com/CosmWasm/wasmd/x/wasm/types"
)

const (
Expand Down
1 change: 1 addition & 0 deletions x/wasm/client/codec/marshaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package codec
import (
"bytes"
"fmt"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/gogo/protobuf/jsonpb"
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/proposal_handler.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package client

import (
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"

"github.com/CosmWasm/wasmd/x/wasm/client/cli"
"github.com/CosmWasm/wasmd/x/wasm/client/rest"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
)

// ProposalHandlers define the wasm cli proposal types and rest handler.
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/proposal_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"os"
"testing"

"github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/gorilla/mux"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmd/x/wasm/keeper"
)

func TestGovRestHandlers(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/rest/gov.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"encoding/json"
"net/http"

"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/CosmWasm/wasmd/x/wasm/types"
)

type StoreCodeProposalJsonReq struct {
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/rest/new_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package rest
import (
"net/http"

"github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/gorilla/mux"

"github.com/CosmWasm/wasmd/x/wasm/types"
)

func registerNewTxRoutes(cliCtx client.Context, r *mux.Router) {
Expand Down
Loading