Skip to content

Commit

Permalink
Merge pull request #107 from e-money/27-upgrade
Browse files Browse the repository at this point in the history
27 upgrade
  • Loading branch information
haasted authored Aug 12, 2021
2 parents 080ded5 + 8f5857f commit 90774ff
Show file tree
Hide file tree
Showing 41 changed files with 2,403 additions and 153 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ jobs:
test:
strategy:
matrix:
go-version: [1.15.x]
os: [ubuntu-latest]
go-version: [1.15.x, 1.16.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
Expand All @@ -14,5 +14,5 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run Makefile Tests
run: make github-ci
- name: Run Go Tests
run: go test ./...
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'

build:
go build -mod=readonly $(BUILD_FLAGS) -o build/emd$(BIN_PREFIX) ./cmd/emd

cosmovisor:
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest

lint:
golangci-lint run

Expand All @@ -59,16 +63,23 @@ fmt:
imp:
gci -w **/*.go


install:
go install -mod=readonly $(BUILD_FLAGS) ./cmd/emd

build-test-upg:
docker run --rm --entrypoint cat emoney/cosmovisor /go/bin/cosmovisor > build/cosmovisor
chmod +x build/cosmovisor
docker run --rm --entrypoint cat emoney/test-upg /go/src/em-ledger/build/emd > "build/emdupg"
chmod +x "build/emdupg"
docker run --rm --entrypoint cat emoney/test-upg /go/src/em-ledger/build/emd-linux > "build/emdupg-linux"
chmod +x "build/emdupg-linux"

build-linux:
# Linux images for docker-compose
# CGO_ENABLED=0 added to solve this issue: https://stackoverflow.com/a/36308464
BIN_PREFIX=-linux LEDGER_ENABLED=false GOOS=linux CGO_ENABLED=0 GOARCH=amd64 $(MAKE) build
BIN_PREFIX=-linux LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

build-all: build-linux
build-all: build-linux build-test-upg
$(MAKE) build

build-docker:
Expand All @@ -82,7 +93,7 @@ test:
go test -mod=readonly ./...

bdd-test:
go test -mod=readonly -v -p 1 -timeout 1h --tags="bdd" bdd_test.go multisigauthority_test.go authority_test.go market_test.go buyback_test.go capacity_test.go staking_test.go bep3swap_test.go
go test -mod=readonly -v -p 1 -timeout 1h --tags="bdd" bdd_test.go multisigauthority_test.go authority_test.go market_test.go buyback_test.go capacity_test.go staking_test.go bep3swap_test.go upgrade_test.go

github-ci: build-linux
$(MAKE) test
Expand All @@ -104,7 +115,7 @@ license:
GO111MODULE=off go get github.com/google/addlicense/
addlicense -f LICENSE .

.PHONY: build build-linux clean test bdd-test build-docker license
.PHONY: build build-linux build-test-upg cosmovisor clean test bdd-test build-docker license

###############################################################################
### Protobuf ###
Expand Down Expand Up @@ -133,6 +144,4 @@ proto-lint:
proto-check-breaking:
@$(DOCKER_BUF) breaking --against-input $(HTTPS_GIT)#branch=master

.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking


.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking
14 changes: 7 additions & 7 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ package emoney
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"time"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/client/rpc"
Expand Down Expand Up @@ -65,11 +71,6 @@ import (
tmos "github.com/tendermint/tendermint/libs/os"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"io"
"net/http"
"os"
"path/filepath"
"time"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -104,7 +105,6 @@ const (
var (
DefaultNodeHome = os.ExpandEnv("$HOME/.emd")

// todo (reviewer) : please check the listed modules carefully. This are the defaults + em modules
ModuleBasics = module.NewBasicManager(
auth.AppModuleBasic{},
genutil.AppModuleBasic{},
Expand Down Expand Up @@ -342,7 +342,7 @@ func NewApp(
app.inflationKeeper = inflation.NewKeeper(app.appCodec, keys[inflation.StoreKey], app.bankKeeper, app.accountKeeper, app.stakingKeeper, buyback.AccountName, authtypes.FeeCollectorName)
app.lpKeeper = liquidityprovider.NewKeeper(app.appCodec, keys[lptypes.StoreKey], app.bankKeeper)
app.issuerKeeper = issuer.NewKeeper(app.appCodec, keys[issuer.StoreKey], app.lpKeeper, app.inflationKeeper)
app.authorityKeeper = authority.NewKeeper(app.appCodec, keys[authority.StoreKey], app.issuerKeeper, app.bankKeeper, app)
app.authorityKeeper = authority.NewKeeper(app.appCodec, keys[authority.StoreKey], app.issuerKeeper, app.bankKeeper, app, &app.upgradeKeeper)
app.marketKeeper = market.NewKeeper(app.appCodec, keys[market.StoreKey], memKeys[market.StoreKeyIdx], app.accountKeeper, app.bankKeeper)
app.buybackKeeper = buyback.NewKeeper(app.appCodec, keys[buyback.StoreKey], app.marketKeeper, app.accountKeeper, app.stakingKeeper, app.bankKeeper)
app.bep3Keeper = bep3.NewKeeper(app.appCodec, keys[bep3.StoreKey], app.bankKeeper, app.accountKeeper, app.paramsKeeper.Subspace(bep3.ModuleName), GetMaccs())
Expand Down
Loading

0 comments on commit 90774ff

Please sign in to comment.