Skip to content

Commit

Permalink
[Feature] Update cosmos-sdk to v0.37.2 (#240)
Browse files Browse the repository at this point in the history
* update to cosmos-v0.37.1

* fix oracle genesis export import feature & clear oracle prevote, vote, price when for-zero-height export

* append genesis test

* update cosmos-sdk to v0.37.2

* Bump Tendermint version to v0.32.6 to address p2p panic errors.

* Bump SDK version to v0.37.3

* merge
  • Loading branch information
yys authored and dokwon committed Oct 16, 2019
1 parent a7d2ba0 commit 35c0d3b
Show file tree
Hide file tree
Showing 16 changed files with 403 additions and 376 deletions.
445 changes: 189 additions & 256 deletions .circleci/config.yml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
# The below include contains the tools target.
include contrib/devtools/Makefile

all: install lint check
all: install lint test

build: go.sum
ifeq ($(OS),Windows_NT)
Expand All @@ -86,7 +86,7 @@ else
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests ./cmd/contract_tests
endif

install: go.sum check-ledger
install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/terrad
go install -mod=readonly $(BUILD_FLAGS) ./cmd/terracli

Expand Down Expand Up @@ -121,19 +121,19 @@ distclean: clean
### Testing


check: check-unit check-build
check-all: check check-race check-cover
test: test-unit test-build
test-all: test test-race test-cover

check-unit:
test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./...

check-race:
test-race:
@VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' ./...

check-cover:
test-cover:
@go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./...

check-build: build
test-build: build
@go test -mod=readonly -p 4 `go list ./cli_test/...` -tags=cli_test -v


Expand Down Expand Up @@ -195,5 +195,5 @@ include sims.mk
.PHONY: all build-linux install install-debug \
go-mod-cache draw-deps clean build \
setup-transactions setup-contract-tests-data start-terra run-lcd-contract-tests contract-tests \
check check-all check-build check-cover check-ledger check-unit check-race
test test-all test-build test-cover test-unit test-race

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Terra Core builds on [Tendermint](https://github.com/tendermint/tendermint) cons

**WARNING**: Terra Core has mostly stabilized, but breaking changes may come regularly.

**Note**: Requires [Go 1.12+](https://golang.org/dl/)
**Note**: Requires [Go 1.13+](https://golang.org/dl/)

## Status

Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (app *TerraApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []s
return false
})

/* Handle market state. */
/* Handle market state. */

// clear all market pools
app.marketKeeper.SetTerraPoolDelta(ctx, sdk.ZeroDec())
Expand Down
11 changes: 10 additions & 1 deletion app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ func appStateFn(
panic("cannot provide both a genesis file and a params file")

case genesisFile != "":
appState, simAccs, chainID = simapp.AppStateFromGenesisFileFn(r, accs, genesisTimestamp)
genesisDoc, accounts := simapp.AppStateFromGenesisFileFn(r)

if genesisTime == 0 {
// use genesis timestamp if no custom timestamp is provided (i.e no random timestamp)
genesisTimestamp = genesisDoc.GenesisTime
}

appState = genesisDoc.AppState
chainID = genesisDoc.ChainID
simAccs = accounts

case paramsFile != "":
appParams := make(simulation.AppParams)
Expand Down
31 changes: 15 additions & 16 deletions contrib/devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd)
###

TOOLS_DESTDIR ?= $(GOPATH)/bin

GOLANGCI_LINT = $(TOOLS_DESTDIR)/golangci-lint
GOIMPORTS = $(TOOLS_DESTDIR)/goimports
CLOG = $(TOOLS_DESTDIR)/clog
RUNSIM = $(TOOLS_DESTDIR)/runsim
GOLANGCI_LINT = $(TOOLS_DESTDIR)/golangci-lint
RUNSIM = $(TOOLS_DESTDIR)/runsim

all: tools

Expand All @@ -56,21 +53,23 @@ tools-stamp: $(GOIMPORTS) $(RUNSIM)
touch $@

$(GOLANGCI_LINT): $(mkfile_dir)/install-golangci-lint.sh
bash $(mkfile_dir)/install-golangci-lint.sh $(TOOLS_DESTDIR) $(GOLANGCI_LINT_VERSION) $(GOLANGCI_LINT_HASHSUM)

$(GOIMPORTS):
go get golang.org/x/tools/cmd/goimports@v0.0.0-20190628034336-212fb13d595e

$(CLOG):
go get github.com/cosmos/tools/cmd/clog/

@echo "Installing golangci-lint..."
@bash $(mkfile_dir)/install-golangci-lint.sh $(TOOLS_DESTDIR) $(GOLANGCI_LINT_VERSION) $(GOLANGCI_LINT_HASHSUM)

# Install the runsim binary with a temporary workaround of entering an outside
# directory as the "go get" command ignores the -mod option and will polute the
# go.{mod, sum} files.
#
# ref: https://github.com/golang/go/issues/30515
$(RUNSIM):
go get github.com/cosmos/tools/cmd/runsim/
@echo "Installing runsim..."
@(cd /tmp && go get github.com/cosmos/tools/cmd/runsim@v1.0.0)

golangci-lint: $(GOLANGCI_LINT)

tools-clean:
rm -f $(GOIMPORTS) $(CLOG) $(GOLANGCI_LINT)
rm -f $(GOLANGCI_LINT)
rm -f $(RUNSIM)
rm -f tools-stamp

.PHONY: all tools tools-clean
.PHONY: all tools tools-clean
2 changes: 1 addition & 1 deletion contrib/gitian-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -euo pipefail

GITIAN_CACHE_DIRNAME='.gitian-builder-cache'
GO_DEBIAN_RELEASE='1.12.7-1'
GO_DEBIAN_RELEASE='1.13.1-1'
GO_TARBALL="golang-debian-${GO_DEBIAN_RELEASE}.tar.gz"
GO_TARBALL_URL="https://salsa.debian.org/go-team/compiler/golang/-/archive/debian/${GO_DEBIAN_RELEASE}/${GO_TARBALL}"

Expand Down
4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/gitian-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ remotes:
- "url": "https://github.com/cosmos/terra.git"
"dir": "terra"
files:
- "golang-debian-1.12.7-1.tar.gz"
- "golang-debian-1.13.1-1.tar.gz"
script: |
set -e -o pipefail
GO_SRC_RELEASE=golang-debian-1.12.7-1
GO_SRC_RELEASE=golang-debian-1.13.1-1
GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
# Compile go and configure the environment
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
Expand Down
4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ remotes:
- "url": "https://github.com/cosmos/terra.git"
"dir": "terra"
files:
- "golang-debian-1.12.7-1.tar.gz"
- "golang-debian-1.13.1-1.tar.gz"
script: |
set -e -o pipefail
GO_SRC_RELEASE=golang-debian-1.12.7-1
GO_SRC_RELEASE=golang-debian-1.13.1-1
GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
# Compile go and configure the environment
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
Expand Down
4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/gitian-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ remotes:
- "url": "https://github.com/cosmos/terra.git"
"dir": "terra"
files:
- "golang-debian-1.12.7-1.tar.gz"
- "golang-debian-1.13.1-1.tar.gz"
script: |
set -e -o pipefail
GO_SRC_RELEASE=golang-debian-1.12.7-1
GO_SRC_RELEASE=golang-debian-1.13.1-1
GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
# Compile go and configure the environment
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
Expand Down
6 changes: 5 additions & 1 deletion docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ Hardware requirements for running a node:
Install `go` by following the [official docs](https://golang.org/doc/install).

{% hint style="info" %}
<<<<<<< HEAD
**Go 1.13+ +** is required for Terra Core.
=======
**Go 1.12+** is required for Terra Core.
>>>>>>> origin/develop
{% endhint %}

> _NOTE_: Before installing `terrad` and `terracli` binaries, let's add the golang binaries to your `PATH` variable. Open your `.bash_profile` or `.zshrc` and append `$HOME/go/bin` to your PATH variable \(i.e. `export PATH=$HOME/bin:$HOME/go/bin`\).
Expand Down Expand Up @@ -45,7 +49,7 @@ terra-money: 0.2.1
git commit: 1fba7308fa226e971964cd6baad9527d4b51d9fc
vendor hash: 1aec7edfad9888a967b3e9063e42f66b28f447e6
build tags: netgo ledger
go version go1.12.1 linux/amd64
go version go1.13.1 linux/amd64
```

### Build Tags
Expand Down
15 changes: 7 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
module github.com/terra-project/core

go 1.12
go 1.13

require (
github.com/cosmos/cosmos-sdk v0.37.0
github.com/cosmos/cosmos-sdk v0.37.3
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d // indirect
github.com/cosmos/tools/cmd/runsim v1.0.0 // indirect
github.com/gorilla/mux v1.7.2
github.com/otiai10/copy v1.0.1
github.com/otiai10/copy v1.0.2
github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect
github.com/pkg/errors v0.8.1
github.com/rakyll/statik v0.1.6
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.3.2
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.4.0
github.com/tendermint/go-amino v0.15.0
github.com/tendermint/tendermint v0.32.2
github.com/tendermint/tm-db v0.1.1
golang.org/x/tools v0.0.0-20190628034336-212fb13d595e // indirect
github.com/tendermint/tendermint v0.32.6
github.com/tendermint/tm-db v0.2.0
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
)
Loading

0 comments on commit 35c0d3b

Please sign in to comment.