Update pending and skip statik in test_lint
This commit is contained in:
parent
e742b02d3b
commit
e496bbd6f5
2
Makefile
2
Makefile
|
@ -167,7 +167,7 @@ test_cover:
|
||||||
@bash tests/test_cover.sh
|
@bash tests/test_cover.sh
|
||||||
|
|
||||||
test_lint:
|
test_lint:
|
||||||
gometalinter.v2 --config=tools/gometalinter.json ./...
|
gometalinter.v2 --config=tools/gometalinter.json ./... | grep -v "client/lcd/statik"
|
||||||
!(gometalinter.v2 --disable-all --enable='errcheck' --vendor ./... | grep -v "client/")
|
!(gometalinter.v2 --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
|
||||||
|
|
|
@ -17,6 +17,7 @@ BREAKING CHANGES
|
||||||
* \#2040 All commands that utilize a validator's address must now use the new
|
* \#2040 All commands that utilize a validator's address must now use the new
|
||||||
bech32 prefix, `cosmosval`. A validator's Tendermint signing key and address
|
bech32 prefix, `cosmosval`. A validator's Tendermint signing key and address
|
||||||
now use a new bech32 prefix, `cosmoscons`.
|
now use a new bech32 prefix, `cosmoscons`.
|
||||||
|
* [cli] \#2215 `gaiacli rest-server` was renamed to `gaiacli lite-server`. In `gaiacli lite-server`, swagger-ui is supported.
|
||||||
|
|
||||||
* Gaia
|
* Gaia
|
||||||
* Make the transient store key use a distinct store key. [#2013](https://github.com/cosmos/cosmos-sdk/pull/2013)
|
* Make the transient store key use a distinct store key. [#2013](https://github.com/cosmos/cosmos-sdk/pull/2013)
|
||||||
|
|
|
@ -164,7 +164,28 @@ type NewKeyBody struct {
|
||||||
Seed string `json:"seed"`
|
Seed string `json:"seed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// add new key REST handler
|
func paramCheck(m NewKeyBody, kb keys.Keybase) (int, string) {
|
||||||
|
if m.Name == "" {
|
||||||
|
return http.StatusBadRequest, fmt.Sprintf("You have to specify a name for the locally stored account.")
|
||||||
|
}
|
||||||
|
if m.Password == "" {
|
||||||
|
return http.StatusBadRequest, fmt.Sprintf("You have to specify a password for the locally stored account.")
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if already exists
|
||||||
|
infos, err := kb.List()
|
||||||
|
if err != nil {
|
||||||
|
return http.StatusInternalServerError, err.Error()
|
||||||
|
}
|
||||||
|
for _, i := range infos {
|
||||||
|
if i.GetName() == m.Name {
|
||||||
|
return http.StatusConflict, fmt.Sprintf("Account with name %s already exists.", m.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return http.StatusOK, ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddNewKeyRequestHandler add new key REST handler
|
||||||
func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request) {
|
func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
var kb keys.Keybase
|
var kb keys.Keybase
|
||||||
var m NewKeyBody
|
var m NewKeyBody
|
||||||
|
@ -190,32 +211,12 @@ func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
code, errMsg := paramCheck(m, kb)
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
if code != http.StatusOK {
|
||||||
w.Write([]byte(err.Error()))
|
w.WriteHeader(code)
|
||||||
|
w.Write([]byte(errMsg))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if m.Name == "" {
|
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
|
||||||
w.Write([]byte("You have to specify a name for the locally stored account."))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if m.Password == "" {
|
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
|
||||||
w.Write([]byte("You have to specify a password for the locally stored account."))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if already exists
|
|
||||||
infos, err := kb.List()
|
|
||||||
for _, i := range infos {
|
|
||||||
if i.GetName() == m.Name {
|
|
||||||
w.WriteHeader(http.StatusConflict)
|
|
||||||
w.Write([]byte(fmt.Sprintf("Account with name %s already exists.", m.Name)))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// create account
|
// create account
|
||||||
seed := m.Seed
|
seed := m.Seed
|
||||||
if seed == "" {
|
if seed == "" {
|
||||||
|
|
|
@ -20,6 +20,7 @@ LCD will be used in the Cosmos Hub, the first Hub in the Cosmos network.
|
||||||
2. [**Get Started**](getting_started.md)
|
2. [**Get Started**](getting_started.md)
|
||||||
3. [**API**](api.md)
|
3. [**API**](api.md)
|
||||||
4. [**Specifications**](specification.md)
|
4. [**Specifications**](specification.md)
|
||||||
|
4. [**Update API docs To Swagger-UI**](update_API_docs.md)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue