Skip to content

Commit

Permalink
Merge pull request #819 from cosmos/release/v0.14.0
Browse files Browse the repository at this point in the history
Release/v0.14.0
  • Loading branch information
ebuchman authored Apr 9, 2018
2 parents 4f0acc4 + 40b193f commit 72bebc6
Show file tree
Hide file tree
Showing 93 changed files with 2,239 additions and 1,719 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 0.14.0 (April 9, 2018)

BREAKING CHANGES:

* [client/builder] Renamed to `client/core` and refactored to use a CoreContext
struct
* [server] Refactor to improve useability and de-duplicate code
* [types] `Result.ToQuery -> Error.QueryResult`
* [makefile] `make build` and `make install` only build/install `gaiacli` and
`gaiad`. Use `make build_examples` and `make install_examples` for
`basecoind/basecli` and `democoind/democli`
* [staking] Various fixes/improvements

FEATURES:

* [democoin] Added Proof-of-Work module

BUG FIXES

* [client] Reuse Tendermint RPC client to avoid excessive open files
* [client] Fix setting log level
* [basecoin] Sort coins in genesis

## 0.13.1 (April 3, 2018)

BUG FIXES
Expand Down
40 changes: 20 additions & 20 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@
name = "github.com/tendermint/iavl"

[[constraint]]
version = "~0.17.1"
version = "~0.18.0"
name = "github.com/tendermint/tendermint"

[[constraint]]
version = "~0.7.1"
[[override]]
version = "~0.8.1"
name = "github.com/tendermint/tmlibs"

[prune]
Expand Down
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PACKAGES=$(shell go list ./... | grep -v '/vendor/')
COMMIT_HASH := $(shell git rev-parse --short HEAD)
BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=${COMMIT_HASH}"

all: check_tools get_vendor_deps build test
all: check_tools get_vendor_deps build build_examples test

########################################
### CI
Expand All @@ -13,13 +13,16 @@ ci: get_tools get_vendor_deps build test_cover
### Build

# This can be unified later, here for easy demos
gaia:
go build $(BUILD_FLAGS) -o build/gaiad ./examples/gaia/gaiad
go build $(BUILD_FLAGS) -o build/gaiacli ./examples/gaia/gaiacli

build:
@rm -rf $(shell pwd)/examples/basecoin/vendor/
@rm -rf $(shell pwd)/examples/democoin/vendor/
ifeq ($(OS),Windows_NT)
go build $(BUILD_FLAGS) -o build/gaiad.exe ./cmd/gaiad
go build $(BUILD_FLAGS) -o build/gaiacli.exe ./cmd/gaiacli
else
go build $(BUILD_FLAGS) -o build/gaiad ./cmd/gaiad
go build $(BUILD_FLAGS) -o build/gaiacli ./cmd/gaiacli
endif

build_examples:
ifeq ($(OS),Windows_NT)
go build $(BUILD_FLAGS) -o build/basecoind.exe ./examples/basecoin/cmd/basecoind
go build $(BUILD_FLAGS) -o build/basecli.exe ./examples/basecoin/cmd/basecli
Expand All @@ -33,6 +36,10 @@ else
endif

install:
go install $(BUILD_FLAGS) ./cmd/gaiad
go install $(BUILD_FLAGS) ./cmd/gaiacli

install_examples:
go install $(BUILD_FLAGS) ./examples/basecoin/cmd/basecoind
go install $(BUILD_FLAGS) ./examples/basecoin/cmd/basecli
go install $(BUILD_FLAGS) ./examples/democoin/cmd/democoind
Expand Down Expand Up @@ -84,12 +91,9 @@ test: test_unit # test_cli
# go test -coverprofile=c.out && go tool cover -html=c.out

test_unit:
@rm -rf examples/basecoin/vendor/
@rm -rf examples/democoin/vendor/
@go test $(PACKAGES)

test_cover:
@rm -rf examples/basecoin/vendor/
@bash tests/test_cover.sh

benchmark:
Expand Down Expand Up @@ -123,4 +127,4 @@ devdoc_update:
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build dist check_tools get_tools get_vendor_deps draw_deps test test_unit test_tutorial benchmark devdoc_init devdoc devdoc_save devdoc_update
.PHONY: build build_examples install install_examples dist check_tools get_tools get_vendor_deps draw_deps test test_unit test_tutorial benchmark devdoc_init devdoc devdoc_save devdoc_update
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![version](https://img.shields.io/github/tag/cosmos/cosmos-sdk.svg)](https://github.com/cosmos/cosmos-sdk/releases/latest)
[![API Reference](https://godoc.org/github.com/cosmos/cosmos-sdk?status.svg
)](https://godoc.org/github.com/cosmos/cosmos-sdk)
[![Rocket.Chat](https://demo.rocket.chat/images/join-chat.svg)](https://cosmos.rocket.chat/)
[![Matrix/Riot](https://demo.rocket.chat/images/join-chat.svg)](https://riot.im/app/#/room/#cosmos-sdk:matrix.org)
[![license](https://img.shields.io/github/license/cosmos/cosmos-sdk.svg)](https://github.com/cosmos/cosmos-sdk/blob/master/LICENSE)
[![LoC](https://tokei.rs/b1/github/cosmos/cosmos-sdk)](https://github.com/cosmos/cosmos-sdk)
[![Go Report Card](https://goreportcard.com/badge/github.com/cosmos/cosmos-sdk)](https://goreportcard.com/report/github.com/cosmos/cosmos-sdk)
Expand Down
2 changes: 1 addition & 1 deletion baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
queryable, ok := app.cms.(sdk.Queryable)
if !ok {
msg := "application doesn't support queries"
return sdk.ErrUnknownRequest(msg).Result().ToQuery()
return sdk.ErrUnknownRequest(msg).QueryResult()
}
return queryable.Query(req)
}
Expand Down
27 changes: 27 additions & 0 deletions client/context/viper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package context

import (
"github.com/spf13/viper"

rpcclient "github.com/tendermint/tendermint/rpc/client"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/core"
)

func NewCoreContextFromViper() core.CoreContext {
nodeURI := viper.GetString(client.FlagNode)
var rpc rpcclient.Client
if nodeURI != "" {
rpc = rpcclient.NewHTTP(nodeURI, "/websocket")
}
return core.CoreContext{
ChainID: viper.GetString(client.FlagChainID),
Height: viper.GetInt64(client.FlagHeight),
TrustNode: viper.GetBool(client.FlagTrustNode),
FromAddressName: viper.GetString(client.FlagName),
NodeURI: nodeURI,
Sequence: viper.GetInt64(client.FlagSequence),
Client: rpc,
}
}
50 changes: 50 additions & 0 deletions client/core/context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package core

import (
rpcclient "github.com/tendermint/tendermint/rpc/client"
)

type CoreContext struct {
ChainID string
Height int64
TrustNode bool
NodeURI string
FromAddressName string
Sequence int64
Client rpcclient.Client
}

func (c CoreContext) WithChainID(chainID string) CoreContext {
c.ChainID = chainID
return c
}

func (c CoreContext) WithHeight(height int64) CoreContext {
c.Height = height
return c
}

func (c CoreContext) WithTrustNode(trustNode bool) CoreContext {
c.TrustNode = trustNode
return c
}

func (c CoreContext) WithNodeURI(nodeURI string) CoreContext {
c.NodeURI = nodeURI
return c
}

func (c CoreContext) WithFromAddressName(fromAddressName string) CoreContext {
c.FromAddressName = fromAddressName
return c
}

func (c CoreContext) WithSequence(sequence int64) CoreContext {
c.Sequence = sequence
return c
}

func (c CoreContext) WithClient(client rpcclient.Client) CoreContext {
c.Client = client
return c
}
Loading

0 comments on commit 72bebc6

Please sign in to comment.