refactor creation of simapp

This commit is contained in:
Jonathan Gimeno 2020-02-21 18:54:10 +01:00
parent e155b1083d
commit 01aaf8446d
2 changed files with 8 additions and 14 deletions

View File

@ -9,8 +9,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/simapp"
abci "github.com/tendermint/tendermint/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/cosmos/cosmos-sdk/x/staking/types"
@ -18,8 +16,7 @@ import (
// tests GetDelegation, GetDelegatorDelegations, SetDelegation, RemoveDelegation, GetDelegatorDelegations
func TestDelegation(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, abci.Header{})
_, app, ctx := getBaseSimappWithCustomKeeper()
//construct the validators
amts := []sdk.Int{sdk.NewInt(9), sdk.NewInt(8), sdk.NewInt(7)}
@ -133,8 +130,7 @@ func TestDelegation(t *testing.T) {
// tests Get/Set/Remove UnbondingDelegation
func TestUnbondingDelegation(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, abci.Header{})
_, app, ctx := getBaseSimappWithCustomKeeper()
ubd := types.NewUnbondingDelegation(
addrDels[0],
@ -177,8 +173,7 @@ func TestUnbondingDelegation(t *testing.T) {
}
func TestUnbondDelegation(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, abci.Header{})
_, app, ctx := getBaseSimappWithCustomKeeper()
codec := simapp.NewAppCodec()
app.StakingKeeper = keeper.NewKeeper(

View File

@ -5,16 +5,15 @@ import (
"encoding/hex"
"strconv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
abci "github.com/tendermint/tendermint/abci/types"
)
var (