mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-30 09:12:14 +00:00
Merge branch 'develop' into feature/enhance-endblock
This commit is contained in:
commit
57a83fe73e
13
Makefile
13
Makefile
@ -1,7 +1,8 @@
|
|||||||
GOTOOLS = \
|
GOTOOLS = \
|
||||||
github.com/mitchellh/gox \
|
github.com/mitchellh/gox \
|
||||||
github.com/Masterminds/glide \
|
github.com/Masterminds/glide \
|
||||||
github.com/alecthomas/gometalinter \
|
gopkg.in/alecthomas/gometalinter.v2 \
|
||||||
|
github.com/ckaznocha/protoc-gen-lint \
|
||||||
github.com/gogo/protobuf/protoc-gen-gogo \
|
github.com/gogo/protobuf/protoc-gen-gogo \
|
||||||
github.com/gogo/protobuf/gogoproto
|
github.com/gogo/protobuf/gogoproto
|
||||||
|
|
||||||
@ -27,6 +28,9 @@ protoc:
|
|||||||
## ldconfig (may require sudo)
|
## ldconfig (may require sudo)
|
||||||
## https://stackoverflow.com/a/25518702
|
## https://stackoverflow.com/a/25518702
|
||||||
protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto
|
protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto
|
||||||
|
@ echo "--> adding nolint declarations to protobuf generated files"
|
||||||
|
@ awk '/package types/ { print "//nolint: gas"; print; next }1' types/types.pb.go > types/types.pb.go.new
|
||||||
|
@ mv types/types.pb.go.new types/types.pb.go
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@ go install ./cmd/...
|
@ go install ./cmd/...
|
||||||
@ -59,7 +63,7 @@ get_deps:
|
|||||||
|
|
||||||
ensure_tools:
|
ensure_tools:
|
||||||
go get -u -v $(GOTOOLS)
|
go get -u -v $(GOTOOLS)
|
||||||
@ gometalinter --install
|
@ gometalinter.v2 --install
|
||||||
|
|
||||||
get_vendor_deps: ensure_tools
|
get_vendor_deps: ensure_tools
|
||||||
@ rm -rf vendor/
|
@ rm -rf vendor/
|
||||||
@ -67,11 +71,12 @@ get_vendor_deps: ensure_tools
|
|||||||
@ glide install
|
@ glide install
|
||||||
|
|
||||||
metalinter_all:
|
metalinter_all:
|
||||||
gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
|
protoc $(INCLUDE) --lint_out=. types/*.proto
|
||||||
|
gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
|
||||||
|
|
||||||
metalinter:
|
metalinter:
|
||||||
@ echo "==> Running linter"
|
@ echo "==> Running linter"
|
||||||
gometalinter --vendor --deadline=600s --disable-all \
|
gometalinter.v2 --vendor --deadline=600s --disable-all \
|
||||||
--enable=maligned \
|
--enable=maligned \
|
||||||
--enable=deadcode \
|
--enable=deadcode \
|
||||||
--enable=goconst \
|
--enable=goconst \
|
||||||
|
@ -2,7 +2,6 @@ machine:
|
|||||||
environment:
|
environment:
|
||||||
GOPATH: /home/ubuntu/.go_workspace
|
GOPATH: /home/ubuntu/.go_workspace
|
||||||
REPO: $GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
|
REPO: $GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
|
||||||
GO15VENDOREXPERIMENT: 1
|
|
||||||
hosts:
|
hosts:
|
||||||
circlehost: 127.0.0.1
|
circlehost: 127.0.0.1
|
||||||
localhost: 127.0.0.1
|
localhost: 127.0.0.1
|
||||||
@ -16,7 +15,7 @@ checkout:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- cd $REPO && make get_vendor_deps && make test_integrations
|
- cd $REPO && make get_vendor_deps && make metalinter_test && make test_integrations
|
||||||
post:
|
post:
|
||||||
- cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt
|
- cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt
|
||||||
- cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}"
|
- cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}"
|
||||||
|
@ -21,7 +21,7 @@ func InitChain(client abcicli.Client) error {
|
|||||||
}
|
}
|
||||||
_, err := client.InitChainSync(types.RequestInitChain{Validators: vals})
|
_, err := client.InitChainSync(types.RequestInitChain{Validators: vals})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed test: InitChain - %v", err)
|
fmt.Printf("Failed test: InitChain - %v\n", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Println("Passed test: InitChain")
|
fmt.Println("Passed test: InitChain")
|
||||||
@ -33,7 +33,7 @@ func SetOption(client abcicli.Client, key, value string) error {
|
|||||||
log := res.GetLog()
|
log := res.GetLog()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed test: SetOption")
|
fmt.Println("Failed test: SetOption")
|
||||||
fmt.Printf("setting %v=%v: \nlog: %v", key, value, log)
|
fmt.Printf("setting %v=%v: \nlog: %v\n", key, value, log)
|
||||||
fmt.Println("Failed test: SetOption")
|
fmt.Println("Failed test: SetOption")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -46,12 +46,12 @@ func Commit(client abcicli.Client, hashExp []byte) error {
|
|||||||
_, data := res.Code, res.Data
|
_, data := res.Code, res.Data
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed test: Commit")
|
fmt.Println("Failed test: Commit")
|
||||||
fmt.Printf("committing %v\nlog: %v", res.GetLog())
|
fmt.Printf("committing %v\nlog: %v\n", data, res.GetLog())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !bytes.Equal(data, hashExp) {
|
if !bytes.Equal(data, hashExp) {
|
||||||
fmt.Println("Failed test: Commit")
|
fmt.Println("Failed test: Commit")
|
||||||
fmt.Printf("Commit hash was unexpected. Got %X expected %X",
|
fmt.Printf("Commit hash was unexpected. Got %X expected %X\n",
|
||||||
data.Bytes(), hashExp)
|
data.Bytes(), hashExp)
|
||||||
return errors.New("CommitTx failed")
|
return errors.New("CommitTx failed")
|
||||||
}
|
}
|
||||||
@ -64,13 +64,13 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []
|
|||||||
code, data, log := res.Code, res.Data, res.Log
|
code, data, log := res.Code, res.Data, res.Log
|
||||||
if code != codeExp {
|
if code != codeExp {
|
||||||
fmt.Println("Failed test: DeliverTx")
|
fmt.Println("Failed test: DeliverTx")
|
||||||
fmt.Printf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v",
|
fmt.Printf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v\n",
|
||||||
code, codeExp, log)
|
code, codeExp, log)
|
||||||
return errors.New("DeliverTx error")
|
return errors.New("DeliverTx error")
|
||||||
}
|
}
|
||||||
if !bytes.Equal(data, dataExp) {
|
if !bytes.Equal(data, dataExp) {
|
||||||
fmt.Println("Failed test: DeliverTx")
|
fmt.Println("Failed test: DeliverTx")
|
||||||
fmt.Printf("DeliverTx response data was unexpected. Got %X expected %X",
|
fmt.Printf("DeliverTx response data was unexpected. Got %X expected %X\n",
|
||||||
data, dataExp)
|
data, dataExp)
|
||||||
return errors.New("DeliverTx error")
|
return errors.New("DeliverTx error")
|
||||||
}
|
}
|
||||||
@ -83,13 +83,13 @@ func CheckTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []by
|
|||||||
code, data, log := res.Code, res.Data, res.Log
|
code, data, log := res.Code, res.Data, res.Log
|
||||||
if code != codeExp {
|
if code != codeExp {
|
||||||
fmt.Println("Failed test: CheckTx")
|
fmt.Println("Failed test: CheckTx")
|
||||||
fmt.Printf("CheckTx response code was unexpected. Got %v expected %v. Log: %v",
|
fmt.Printf("CheckTx response code was unexpected. Got %v expected %v. Log: %v\n",
|
||||||
code, codeExp, log)
|
code, codeExp, log)
|
||||||
return errors.New("CheckTx")
|
return errors.New("CheckTx")
|
||||||
}
|
}
|
||||||
if !bytes.Equal(data, dataExp) {
|
if !bytes.Equal(data, dataExp) {
|
||||||
fmt.Println("Failed test: CheckTx")
|
fmt.Println("Failed test: CheckTx")
|
||||||
fmt.Printf("CheckTx response data was unexpected. Got %X expected %X",
|
fmt.Printf("CheckTx response data was unexpected. Got %X expected %X\n",
|
||||||
data, dataExp)
|
data, dataExp)
|
||||||
return errors.New("CheckTx")
|
return errors.New("CheckTx")
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -44,6 +44,7 @@ It has these top-level messages:
|
|||||||
Evidence
|
Evidence
|
||||||
KVPair
|
KVPair
|
||||||
*/
|
*/
|
||||||
|
//nolint: gas
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import proto "github.com/gogo/protobuf/proto"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user