Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update consensus and sdk versions #15

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func NewWasmApp(
// there is nothing left over in the validator fee pool, so as to keep the
// CanWithdrawInvariant invariant.

app.mm.SetOrderBeginBlockers(upgrade.ModuleName, mint.ModuleName, distr.ModuleName, slashing.ModuleName)
app.mm.SetOrderBeginBlockers(upgrade.ModuleName, mint.ModuleName, distr.ModuleName, slashing.ModuleName, staking.ModuleName)
app.mm.SetOrderEndBlockers(crisis.ModuleName, gov.ModuleName, staking.ModuleName)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ require (
replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4

// this include a few extra debug helpers on top of cosmos v0.38.3 but original also works fine
replace github.com/cosmos/cosmos-sdk => github.com/fetchai/cosmos-sdk v0.6.0
replace github.com/cosmos/cosmos-sdk => github.com/fetchai/cosmos-sdk v0.7.0

replace github.com/tendermint/tendermint => github.com/fetchai/cosmos-consensus v0.5.1
replace github.com/tendermint/tendermint => github.com/fetchai/cosmos-consensus v0.6.0
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqL
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y=
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fetchai/cosmos-consensus v0.5.1 h1:ao9iReK63iZ23SmQy6FUEKx5gOyZBIiJY5p+oP/AWT0=
github.com/fetchai/cosmos-consensus v0.5.1/go.mod h1:iDSJXmKFKyNiZnvCwrGkecKkPo5aNJuZST9dR4NSp2U=
github.com/fetchai/cosmos-sdk v0.6.0 h1:pR19LftF+TZm0dO9a6j6dyTXfVh0g2rUkUcB8RrO6ZI=
github.com/fetchai/cosmos-sdk v0.6.0/go.mod h1:FdmqikjcldwGeVM3SKy+NKXZxxdr/H4DhkGZMMSMzY8=
github.com/fetchai/cosmos-consensus v0.6.0 h1:/mmC+oz5KLXiJsqXsPsqOwR4YIwnFoeUac/MyXLNUJk=
github.com/fetchai/cosmos-consensus v0.6.0/go.mod h1:iDSJXmKFKyNiZnvCwrGkecKkPo5aNJuZST9dR4NSp2U=
github.com/fetchai/cosmos-sdk v0.7.0 h1:MaCt6whC7ebljuyVGXtqSkNf/n4m1k2N15fXGqPXaEs=
github.com/fetchai/cosmos-sdk v0.7.0/go.mod h1:gkYKyFWTtgKkF8c1qeViDuL/eriEq9tMgDLYumK1oLc=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
Expand Down
11 changes: 7 additions & 4 deletions x/wasm/internal/keeper/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ package keeper

import (
"encoding/json"
"io/ioutil"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: shuffled imports

Copy link
Contributor Author

@jinmannwong jinmannwong Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my editor did this but I think the change is consistent with how the imports are normally ordered in Tendermint so I lett it.

"os"
"testing"

"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/assert"
"io/ioutil"
"os"
"testing"

"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendermint/abci/types"
)

type StakingInitMsg struct {
Expand Down Expand Up @@ -448,9 +450,10 @@ func addValidator(ctx sdk.Context, stakingKeeper staking.Keeper, accountKeeper a
// this will commit the current set, update the block height and set historic info
// basically, letting two blocks pass
func nextBlock(ctx sdk.Context, stakingKeeper staking.Keeper) sdk.Context {
staking.BeginBlocker(ctx, abci.RequestBeginBlock{}, stakingKeeper)
staking.EndBlocker(ctx, stakingKeeper)
ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1)
staking.BeginBlocker(ctx, stakingKeeper)
staking.BeginBlocker(ctx, abci.RequestBeginBlock{}, stakingKeeper)
return ctx
}

Expand Down
4 changes: 3 additions & 1 deletion x/wasm/internal/keeper/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package keeper

import (
"fmt"
"github.com/cosmos/cosmos-sdk/x/distribution"
"testing"
"time"

"github.com/cosmos/cosmos-sdk/x/distribution"

"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
Expand Down Expand Up @@ -119,6 +120,7 @@ func CreateTestInput(t *testing.T, isCheckTx bool, tempDir string, supportedFeat
supplyKeeper := supply.NewKeeper(cdc, keySupply, accountKeeper, bankKeeper, maccPerms)
stakingKeeper := staking.NewKeeper(cdc, keyStaking, supplyKeeper, pk.Subspace(staking.DefaultParamspace))
stakingKeeper.SetParams(ctx, TestingStakeParams)
stakingKeeper.SetDelayValidatorUpdates(false)

distKeeper := distribution.NewKeeper(cdc, keyDistro, pk.Subspace(distribution.DefaultParamspace), stakingKeeper, supplyKeeper, auth.FeeCollectorName, nil)
distKeeper.SetParams(ctx, distribution.DefaultParams())
Expand Down
8 changes: 4 additions & 4 deletions x/wasm/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (

abci "github.com/tendermint/tendermint/abci/types"

"github.com/fetchai/fetchd/x/wasm/client/cli"
"github.com/fetchai/fetchd/x/wasm/client/rest"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/fetchai/fetchd/x/wasm/client/cli"
"github.com/fetchai/fetchd/x/wasm/client/rest"
)

var (
Expand Down Expand Up @@ -132,6 +132,6 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}

// EndBlock returns the end blocker for the wasm module. It returns no validator
// updates.
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) ([]abci.ValidatorUpdate, []abci.ValidatorUpdate) {
return []abci.ValidatorUpdate{}, []abci.ValidatorUpdate{}
}