Skip to content

Commit

Permalink
Merge PR cosmos#3660: Release v0.32.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin authored Feb 18, 2019
2 parents 05de813 + 6252de8 commit 19f0f92
Show file tree
Hide file tree
Showing 195 changed files with 5,065 additions and 1,279 deletions.
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 0.32.0

BREAKING CHANGES

* Gaia REST API
* [\#3642](https://github.com/cosmos/cosmos-sdk/pull/3642) `GET /tx/{hash}` now returns `404` instead of `500` if the transaction is not found

* SDK
* [\#3580](https://github.com/cosmos/cosmos-sdk/issues/3580) Migrate HTTP request/response types and utilities to types/rest.
* [\#3592](https://github.com/cosmos/cosmos-sdk/issues/3592) Drop deprecated keybase implementation's New() constructor in
favor of a new crypto/keys.New(string, string) implementation that
returns a lazy keybase instance. Remove client.MockKeyBase,
superseded by crypto/keys.NewInMemory()
* [\#3621](https://github.com/cosmos/cosmos-sdk/issues/3621) staking.GenesisState.Bonds -> Delegations

IMPROVEMENTS

* SDK
* [\#3311] Reconcile the `DecCoin/s` API with the `Coin/s` API.
* [\#3614] Add coin denom length checks to the coins constructors.
* [\#3621](https://github.com/cosmos/cosmos-sdk/issues/3621) remove many inter-module dependancies
* [\#3601] JSON-stringify the ABCI log response which includes the log and message
index.
* [\#3604] Improve SDK funds related error messages and allow for unicode in
JSON ABCI log.
* [\#3620](https://github.com/cosmos/cosmos-sdk/pull/3620) Version command shows build tags
* [\#3638] Add Bcrypt benchmarks & justification of security parameter choice
* [\#3648] Add JSON struct tags to vesting accounts.

* Tendermint
* [\#3618] Upgrade to Tendermint 0.30.03

BUG FIXES

* SDK
* [\#3646](https://github.com/cosmos/cosmos-sdk/issues/3646) `x/mint` now uses total token supply instead of total bonded tokens to calculate inflation


## 0.31.2

BREAKING CHANGES
Expand Down Expand Up @@ -527,7 +565,7 @@ BREAKING CHANGES
* [gaiad init] [\#2602](https://github.com/cosmos/cosmos-sdk/issues/2602) New genesis workflow

* SDK
* [simulation] [\#2665](https://github.com/cosmos/cosmos-sdk/issues/2665) only argument to simulation.Invariant is now app
* [simulation] [\#2665](https://github.com/cosmos/cosmos-sdk/issues/2665) only argument to sdk.Invariant is now app

* Tendermint
* Upgrade to version 0.26.0
Expand Down
2 changes: 1 addition & 1 deletion Gopkg.lock

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

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

[[override]]
name = "github.com/tendermint/tendermint"
revision = "v0.30.0-rc0"
revision = "v0.30.0"

[[constraint]]
name = "github.com/zondax/ledger-cosmos-go"
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
BUILD_TAGS = netgo
CAT := $(if $(filter $(OS),Windows_NT),type,cat)
BUILD_FLAGS = -tags "${BUILD_TAGS}" -ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.VendorDirHash=$(shell $(CAT) vendor-deps)"
BUILD_FLAGS = -tags "$(BUILD_TAGS)" -ldflags \
'-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/cosmos/cosmos-sdk/version.VendorDirHash=$(shell $(CAT) vendor-deps) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(BUILD_TAGS)"'
LEDGER_ENABLED ?= true
GOTOOLS = \
github.com/golang/dep/cmd/dep \
Expand Down
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BREAKING CHANGES

* Tendermint


FEATURES

* Gaia REST API
Expand Down
21 changes: 16 additions & 5 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,15 @@ func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) (ctx sdk.Con
return
}

type indexedABCILog struct {
MsgIndex int `json:"msg_index"`
Success bool `json:"success"`
Log string `json:"log"`
}

// runMsgs iterates through all the messages and executes them.
func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (result sdk.Result) {
logs := make([]string, 0, len(msgs))
idxlogs := make([]indexedABCILog, 0, len(msgs)) // a list of JSON-encoded logs with msg index

var data []byte // NOTE: we just append them all (?!)
var tags sdk.Tags // also just append them all
Expand Down Expand Up @@ -659,23 +665,28 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (re
tags = append(tags, sdk.MakeTag(sdk.TagAction, msg.Type()))
tags = append(tags, msgResult.Tags...)

idxLog := indexedABCILog{MsgIndex: msgIdx, Log: msgResult.Log}

// stop execution and return on first failed message
if !msgResult.IsOK() {
logs = append(logs, fmt.Sprintf("Msg %d failed: %s", msgIdx, msgResult.Log))
idxLog.Success = false
idxlogs = append(idxlogs, idxLog)

code = msgResult.Code
codespace = msgResult.Codespace
break
}

// construct usable logs in multi-message transactions
logs = append(logs, fmt.Sprintf("Msg %d: %s", msgIdx, msgResult.Log))
idxLog.Success = true
idxlogs = append(idxlogs, idxLog)
}

logJSON := codec.Cdc.MustMarshalJSON(idxlogs)
result = sdk.Result{
Code: code,
Codespace: codespace,
Data: data,
Log: strings.Join(logs, "\n"),
Log: strings.TrimSpace(string(logJSON)),
GasUsed: ctx.GasMeter().GasConsumed(),
Tags: tags,
}
Expand Down
2 changes: 1 addition & 1 deletion baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestBaseAppOptionSeal(t *testing.T) {
}

func TestSetMinGasPrices(t *testing.T) {
minGasPrices := sdk.DecCoins{sdk.NewDecCoin("stake", 5000)}
minGasPrices := sdk.DecCoins{sdk.NewInt64DecCoin("stake", 5000)}
app := newBaseApp(t.Name(), SetMinGasPrices(minGasPrices.String()))
require.Equal(t, minGasPrices, app.minGasPrices)
}
Expand Down
5 changes: 3 additions & 2 deletions client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/cmd/gaia/app"
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"

"errors"

Expand Down Expand Up @@ -399,7 +400,7 @@ func AddNewKeyRequestHandler(indent bool) http.HandlerFunc {

keyOutput.Mnemonic = mnemonic

PostProcessResponse(w, cdc, keyOutput, indent)
rest.PostProcessResponse(w, cdc, keyOutput, indent)
}
}

Expand Down Expand Up @@ -488,6 +489,6 @@ func RecoverRequestHandler(indent bool) http.HandlerFunc {
return
}

PostProcessResponse(w, cdc, keyOutput, indent)
rest.PostProcessResponse(w, cdc, keyOutput, indent)
}
}
5 changes: 3 additions & 2 deletions client/keys/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keys
import (
"net/http"

"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -49,7 +50,7 @@ func QueryKeysRequestHandler(indent bool) http.HandlerFunc {
}
// an empty list will be JSONized as null, but we want to keep the empty list
if len(infos) == 0 {
PostProcessResponse(w, cdc, []string{}, indent)
rest.PostProcessResponse(w, cdc, []string{}, indent)
return
}
keysOutput, err := Bech32KeysOutput(infos)
Expand All @@ -58,6 +59,6 @@ func QueryKeysRequestHandler(indent bool) http.HandlerFunc {
_, _ = w.Write([]byte(err.Error()))
return
}
PostProcessResponse(w, cdc, keysOutput, indent)
rest.PostProcessResponse(w, cdc, keysOutput, indent)
}
}
3 changes: 2 additions & 1 deletion client/keys/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/tendermint/tendermint/crypto"

"github.com/cosmos/cosmos-sdk/crypto/keys"
"github.com/cosmos/cosmos-sdk/types/rest"

"errors"

Expand Down Expand Up @@ -188,6 +189,6 @@ func GetKeyRequestHandler(indent bool) http.HandlerFunc {
return
}

PostProcessResponse(w, cdc, keyOutput, indent)
rest.PostProcessResponse(w, cdc, keyOutput, indent)
}
}
25 changes: 0 additions & 25 deletions client/keys/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package keys

import (
"fmt"
"net/http"
"path/filepath"

"github.com/spf13/viper"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down Expand Up @@ -217,26 +215,3 @@ func printPubKey(info keys.Info, bechKeyOut bechKeyOutFn) {

fmt.Println(ko.PubKey)
}

// PostProcessResponse performs post process for rest response
func PostProcessResponse(w http.ResponseWriter, cdc *codec.Codec, response interface{}, indent bool) {
var output []byte
switch response.(type) {
default:
var err error
if indent {
output, err = cdc.MarshalJSONIndent(response, "", " ")
} else {
output, err = cdc.MarshalJSON(response)
}
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
_, _ = w.Write([]byte(err.Error()))
return
}
case []byte:
output = response.([]byte)
}
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write(output)
}
Loading

0 comments on commit 19f0f92

Please sign in to comment.