Merge pull request #8 from cosmos/cwgoes/patch-fix

Minor cleanup
This commit is contained in:
HaoyangLiu 2018-10-04 18:42:23 +08:00 committed by GitHub
commit d46b5629c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 31 additions and 32 deletions

View File

@ -3,7 +3,7 @@ version: 2
defaults: &defaults defaults: &defaults
working_directory: /go/src/github.com/cosmos/cosmos-sdk working_directory: /go/src/github.com/cosmos/cosmos-sdk
docker: docker:
- image: circleci/golang:1.10.3 - image: circleci/golang:1.11.1
environment: environment:
GOBIN: /tmp/workspace/bin GOBIN: /tmp/workspace/bin

View File

@ -45,7 +45,7 @@ build-linux:
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
update_gaia_lite_docs: update_gaia_lite_docs:
@statik -src=client/lcd/swagger-ui -dest=client/lcd @statik -src=client/lcd/swagger-ui -dest=client/lcd -f
build_cosmos-sdk-cli: build_cosmos-sdk-cli:
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
@ -182,14 +182,14 @@ test_cover:
test_lint: test_lint:
gometalinter.v2 --config=tools/gometalinter.json ./... gometalinter.v2 --config=tools/gometalinter.json ./...
!(gometalinter.v2 --exclude /usr/lib/go/src/ --disable-all --enable='errcheck' --vendor ./... | grep -v "client/") !(gometalinter.v2 --exclude /usr/lib/go/src/ --exclude client/lcd/statik/statik.go --disable-all --enable='errcheck' --vendor ./... | grep -v "client/")
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
dep status >> /dev/null dep status >> /dev/null
!(grep -n branch Gopkg.toml) !(grep -n branch Gopkg.toml)
format: format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs misspell -w find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
benchmark: benchmark:
@go test -bench=. $(PACKAGES_NOSIMULATION) @go test -bench=. $(PACKAGES_NOSIMULATION)

View File

@ -50,7 +50,7 @@ type CLIContext struct {
GenerateOnly bool GenerateOnly bool
fromAddress types.AccAddress fromAddress types.AccAddress
fromName string fromName string
Indent bool Indent bool
} }
// NewCLIContext returns a new initialized CLIContext with parameters from the // NewCLIContext returns a new initialized CLIContext with parameters from the

View File

@ -17,25 +17,25 @@ const (
DefaultGasLimit = 200000 DefaultGasLimit = 200000
GasFlagSimulate = "simulate" GasFlagSimulate = "simulate"
FlagUseLedger = "ledger" FlagUseLedger = "ledger"
FlagChainID = "chain-id" FlagChainID = "chain-id"
FlagNode = "node" FlagNode = "node"
FlagHeight = "height" FlagHeight = "height"
FlagGas = "gas" FlagGas = "gas"
FlagGasAdjustment = "gas-adjustment" FlagGasAdjustment = "gas-adjustment"
FlagTrustNode = "trust-node" FlagTrustNode = "trust-node"
FlagFrom = "from" FlagFrom = "from"
FlagName = "name" FlagName = "name"
FlagAccountNumber = "account-number" FlagAccountNumber = "account-number"
FlagSequence = "sequence" FlagSequence = "sequence"
FlagMemo = "memo" FlagMemo = "memo"
FlagFee = "fee" FlagFee = "fee"
FlagAsync = "async" FlagAsync = "async"
FlagJson = "json" FlagJson = "json"
FlagPrintResponse = "print-response" FlagPrintResponse = "print-response"
FlagDryRun = "dry-run" FlagDryRun = "dry-run"
FlagGenerateOnly = "generate-only" FlagGenerateOnly = "generate-only"
FlagIndentResponse= "indent" FlagIndentResponse = "indent"
) )
// LineBreak can be included in a command list to provide a blank line // LineBreak can be included in a command list to provide a blank line

View File

@ -372,8 +372,8 @@ func TestCoinSendGenerateSignAndBroadcast(t *testing.T) {
// broadcast tx // broadcast tx
broadcastPayload := struct { broadcastPayload := struct {
Tx auth.StdTx `json:"tx"` Tx auth.StdTx `json:"tx"`
Return string `json:"return"` Return string `json:"return"`
}{Tx: signedMsg, Return: "block"} }{Tx: signedMsg, Return: "block"}
json, err = cdc.MarshalJSON(broadcastPayload) json, err = cdc.MarshalJSON(broadcastPayload)
require.Nil(t, err) require.Nil(t, err)

View File

@ -141,7 +141,6 @@ func createHandler(cdc *codec.Codec) *mux.Router {
cliCtx := context.NewCLIContext().WithCodec(cdc) cliCtx := context.NewCLIContext().WithCodec(cdc)
// TODO: make more functional? aka r = keys.RegisterRoutes(r) // TODO: make more functional? aka r = keys.RegisterRoutes(r)
r.HandleFunc("/version", CLIVersionRequestHandler).Methods("GET") r.HandleFunc("/version", CLIVersionRequestHandler).Methods("GET")
r.HandleFunc("/node_version", NodeVersionRequestHandler(cliCtx)).Methods("GET") r.HandleFunc("/node_version", NodeVersionRequestHandler(cliCtx)).Methods("GET")

View File

@ -8,11 +8,11 @@ import (
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/utils"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
tmliteProxy "github.com/tendermint/tendermint/lite/proxy" tmliteProxy "github.com/tendermint/tendermint/lite/proxy"
"github.com/cosmos/cosmos-sdk/client/utils"
) )
//BlockCommand returns the verified block data for a given heights //BlockCommand returns the verified block data for a given heights

View File

@ -13,11 +13,11 @@ import (
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/utils"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth"
"github.com/spf13/viper" "github.com/spf13/viper"
"github.com/cosmos/cosmos-sdk/client/utils"
) )
// QueryTxCmd implements the default command for a tx query. // QueryTxCmd implements the default command for a tx query.

View File

@ -15,8 +15,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/cosmos/cosmos-sdk/client/utils" "github.com/cosmos/cosmos-sdk/client/utils"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
) )
const ( const (

View File

@ -6,5 +6,5 @@
"Deadline": "500s", "Deadline": "500s",
"Vendor": true, "Vendor": true,
"Cyclo": 11, "Cyclo": 11,
"Exclude": ["/usr/lib/go/src/"] "Exclude": ["/usr/lib/go/src/", "client/lcd/statik/statik.go"]
} }