Skip to content

Commit 14cdb34

Browse files
Maxxlab
authored andcommitted
fix: update unit tests of other modules. refactor x/interchainquery tests
1 parent 39d7538 commit 14cdb34

File tree

18 files changed

+55
-51
lines changed

18 files changed

+55
-51
lines changed

ibctesting/simapp/simd/cmd/testnet.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ func InitTestnet(
212212
sdk.NewCoin(sdk.DefaultBondDenom, valTokens),
213213
stakingtypes.NewDescription(nodeDirName, "", "", "", ""),
214214
stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()),
215-
sdk.OneInt(),
216215
)
217216
if err != nil {
218217
return err

simapp/app.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ import (
7171
ibc "github.com/cosmos/ibc-go/v6/modules/core"
7272
ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host"
7373
ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
74-
ibctesting "github.com/cosmos/ibc-go/v6/testing"
75-
ibctestingtypes "github.com/cosmos/ibc-go/v6/testing/types"
7674
"github.com/gorilla/mux"
75+
ibctestingtypes "github.com/persistenceOne/persistence-sdk/v2/ibctesting/types"
7776
distr "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/distribution"
7877
distrclient "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/distribution/client"
7978
distrkeeper "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/distribution/keeper"
@@ -159,7 +158,6 @@ var (
159158
var (
160159
_ App = (*SimApp)(nil)
161160
_ servertypes.Application = (*SimApp)(nil)
162-
_ ibctesting.TestingApp = (*SimApp)(nil)
163161
)
164162

165163
// SimApp extends an ABCI application, but with most of its parameters exported.

simapp/simd/cmd/genaccounts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"github.com/cosmos/cosmos-sdk/testutil/testdata"
1414
sdk "github.com/cosmos/cosmos-sdk/types"
1515
"github.com/cosmos/cosmos-sdk/types/module"
16-
genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil"
1716
"github.com/persistenceOne/persistence-sdk/v2/simapp"
1817
simcmd "github.com/persistenceOne/persistence-sdk/v2/simapp/simd/cmd"
1918
"github.com/persistenceOne/persistence-sdk/v2/x/lsnative/genutil"
19+
genutiltest "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/genutil/client/testutil"
2020
"github.com/spf13/viper"
2121
"github.com/stretchr/testify/require"
2222
"github.com/tendermint/tendermint/libs/log"

simapp/simd/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/cosmos/cosmos-sdk/x/auth/types"
2121
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2222
"github.com/cosmos/cosmos-sdk/x/crisis"
23-
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
23+
genutilcli "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/genutil/client/cli"
2424
"github.com/spf13/cast"
2525
"github.com/spf13/cobra"
2626
tmcfg "github.com/tendermint/tendermint/config"

simapp/simd/cmd/testnet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/cosmos/cosmos-sdk/client/flags"
1010
"github.com/cosmos/cosmos-sdk/server"
1111
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
12-
genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil"
1312
"github.com/persistenceOne/persistence-sdk/v2/simapp"
13+
genutiltest "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/genutil/client/testutil"
1414
genutiltypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/genutil/types"
1515
"github.com/spf13/viper"
1616
"github.com/stretchr/testify/require"

simapp/test_helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2828
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
2929
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
30-
ibctesting "github.com/cosmos/ibc-go/v6/testing"
30+
"github.com/persistenceOne/persistence-sdk/v2/ibctesting"
3131
"github.com/persistenceOne/persistence-sdk/v2/simapp/helpers"
3232
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
3333
"github.com/stretchr/testify/require"

x/interchainquery/genesis_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"testing"
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
7-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
8-
ibctesting "github.com/cosmos/ibc-go/v6/testing"
97
"github.com/stretchr/testify/suite"
108

9+
ibctesting "github.com/persistenceOne/persistence-sdk/v2/ibctesting"
1110
"github.com/persistenceOne/persistence-sdk/v2/simapp"
1211
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery"
1312
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/keeper"
1413
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
14+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
1515
)
1616

1717
func init() {

x/interchainquery/keeper/abci_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ package keeper_test
22

33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
5-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
5+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
66

7+
"github.com/persistenceOne/persistence-sdk/v2/ibctesting"
78
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/keeper"
89
)
910

1011
func (suite *KeeperTestSuite) TestEndBlocker() {
12+
validators := suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext())
13+
1114
qvr := stakingtypes.QueryValidatorsResponse{
12-
Validators: suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext()),
15+
Validators: ibctesting.SdkValidatorsToValidators(validators),
1316
}
1417

1518
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: stakingtypes.BondStatusBonded}

x/interchainquery/keeper/grpc_query_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package keeper_test
22

33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
5-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
5+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
66

77
icqtypes "github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
88
)

x/interchainquery/keeper/keeper_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import (
44
"testing"
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
7-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
8-
ibctesting "github.com/cosmos/ibc-go/v6/testing"
7+
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
98
"github.com/stretchr/testify/suite"
109

10+
"github.com/persistenceOne/persistence-sdk/v2/ibctesting"
1111
"github.com/persistenceOne/persistence-sdk/v2/simapp"
1212
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/keeper"
1313
icqtypes "github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
14+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
1415
)
1516

1617
const TestOwnerAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs"
@@ -52,7 +53,7 @@ func (suite *KeeperTestSuite) SetupTest() {
5253
}
5354

5455
func (suite *KeeperTestSuite) TestMakeRequest() {
55-
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: stakingtypes.BondStatusBonded}
56+
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: sdkstaking.BondStatusBonded}
5657
bz, err := bondedQuery.Marshal()
5758
suite.NoError(err)
5859

@@ -91,12 +92,13 @@ func (suite *KeeperTestSuite) TestMakeRequest() {
9192
}
9293

9394
func (suite *KeeperTestSuite) TestSubmitQueryResponse() {
94-
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: stakingtypes.BondStatusBonded}
95+
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: sdkstaking.BondStatusBonded}
9596
bz, err := bondedQuery.Marshal()
9697
suite.NoError(err)
9798

99+
validators := suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext())
98100
qvr := stakingtypes.QueryValidatorsResponse{
99-
Validators: suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext()),
101+
Validators: ibctesting.SdkValidatorsToValidators(validators),
100102
}
101103

102104
tests := []struct {
@@ -192,12 +194,13 @@ func (suite *KeeperTestSuite) TestSubmitQueryResponse() {
192194
}
193195

194196
func (suite *KeeperTestSuite) TestDataPoints() {
195-
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: stakingtypes.BondStatusBonded}
197+
bondedQuery := stakingtypes.QueryValidatorsRequest{Status: sdkstaking.BondStatusBonded}
196198
bz, err := bondedQuery.Marshal()
197199
suite.NoError(err)
198200

201+
validators := suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext())
199202
qvr := stakingtypes.QueryValidatorsResponse{
200-
Validators: suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext()),
203+
Validators: ibctesting.SdkValidatorsToValidators(validators),
201204
}
202205

203206
id := keeper.GenerateQueryHash(suite.path.EndpointB.ConnectionID, suite.chainB.ChainID, "cosmos.staking.v1beta1.Query/Validators", bz, "")

x/interchainquery/keeper/queries_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package keeper_test
22

33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
5-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
5+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
66

77
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/keeper"
88
)

x/interchainquery/types/msgs_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package types_test
33
import (
44
"testing"
55

6-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
7-
ibctesting "github.com/cosmos/ibc-go/v6/testing"
86
"github.com/stretchr/testify/require"
97

8+
"github.com/persistenceOne/persistence-sdk/v2/ibctesting"
109
"github.com/persistenceOne/persistence-sdk/v2/simapp"
1110
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/keeper"
1211
"github.com/persistenceOne/persistence-sdk/v2/x/interchainquery/types"
12+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
1313
)
1414

1515
const TestOwnerAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs"
@@ -53,8 +53,9 @@ func TestMsgSubmitQueryResponse(t *testing.T) {
5353
bz, err := bondedQuery.Marshal()
5454
require.NoError(t, err)
5555

56+
validators := GetSimApp(chainB).StakingKeeper.GetBondedValidatorsByPower(chainB.GetContext())
5657
qvr := stakingtypes.QueryValidatorsResponse{
57-
Validators: GetSimApp(chainB).StakingKeeper.GetBondedValidatorsByPower(chainB.GetContext()),
58+
Validators: ibctesting.SdkValidatorsToValidators(validators),
5859
}
5960

6061
msg := types.MsgSubmitQueryResponse{

x/oracle/keeper/keeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1111
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
12-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
12+
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
1313
gogotypes "github.com/gogo/protobuf/types"
1414
"github.com/tendermint/tendermint/libs/log"
1515

@@ -143,7 +143,7 @@ func (k Keeper) IterateExchangeRates(ctx sdk.Context, handler func(string, sdk.D
143143
func (k Keeper) GetFeederDelegation(ctx sdk.Context, operator sdk.ValAddress) (sdk.AccAddress, error) {
144144
// check that the given validator exists
145145
if val := k.StakingKeeper.Validator(ctx, operator); val == nil || !val.IsBonded() {
146-
return nil, sdkerrors.Wrapf(stakingtypes.ErrNoValidatorFound, "validator %s is not active set", operator.String())
146+
return nil, sdkerrors.Wrapf(sdkstaking.ErrNoValidatorFound, "validator %s is not active set", operator.String())
147147
}
148148

149149
store := ctx.KVStore(k.storeKey)

x/oracle/keeper/msg_server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
77
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
8-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
8+
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
99

1010
"github.com/persistenceOne/persistence-sdk/v2/x/oracle/types"
1111
)
@@ -159,7 +159,7 @@ func (ms msgServer) DelegateFeedConsent(
159159

160160
val := ms.StakingKeeper.Validator(ctx, operatorAddr)
161161
if val == nil {
162-
return nil, sdkerrors.Wrap(stakingtypes.ErrNoValidatorFound, msg.Operator)
162+
return nil, sdkerrors.Wrap(sdkstaking.ErrNoValidatorFound, msg.Operator)
163163
}
164164

165165
ms.SetFeederDelegation(ctx, operatorAddr, delegateAddr)

x/oracle/keeper/slash_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package keeper_test
33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
55

6-
"github.com/cosmos/cosmos-sdk/x/staking"
7-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
6+
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
7+
"github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking"
88
"github.com/persistenceOne/persistence-sdk/v2/x/oracle/testutil"
99
"github.com/persistenceOne/persistence-sdk/v2/x/oracle/types"
1010
)
@@ -38,42 +38,42 @@ func (s *KeeperTestSuite) TestSlashAndResetMissCounters() {
3838
s.app.OracleKeeper.SlashAndResetMissCounters(s.ctx)
3939
staking.EndBlocker(s.ctx, s.app.StakingKeeper)
4040

41-
validator, _ := s.app.StakingKeeper.GetValidator(s.ctx, valAddr)
41+
validator, _ := s.app.StakingKeeper.GetLiquidValidator(s.ctx, valAddr)
4242
s.Require().Equal(amt, validator.GetBondedTokens())
4343

4444
// Case 2, slash
4545
s.app.OracleKeeper.SetMissCounter(s.ctx, valAddr, missCounterSlash)
4646
s.app.OracleKeeper.SlashAndResetMissCounters(s.ctx)
4747

48-
validator, _ = s.app.StakingKeeper.GetValidator(s.ctx, valAddr)
48+
validator, _ = s.app.StakingKeeper.GetLiquidValidator(s.ctx, valAddr)
4949
s.Require().Equal(amt.Sub(params.SlashFraction.MulInt(amt).TruncateInt()), validator.GetBondedTokens())
5050
s.Require().True(validator.Jailed)
5151

5252
missCounter := app.OracleKeeper.GetMissCounter(ctx, valAddr)
5353
s.Require().Zero(missCounter)
5454

5555
// Case 3, slash unbonded validator
56-
validator, _ = s.app.StakingKeeper.GetValidator(s.ctx, valAddr)
57-
validator.Status = stakingtypes.Unbonded
56+
validator, _ = s.app.StakingKeeper.GetLiquidValidator(s.ctx, valAddr)
57+
validator.Status = sdkstaking.Unbonded
5858
validator.Jailed = false
5959
validator.Tokens = amt
6060
s.app.StakingKeeper.SetValidator(s.ctx, validator)
6161

6262
s.app.OracleKeeper.SetMissCounter(s.ctx, valAddr, missCounterSlash)
6363
s.app.OracleKeeper.SlashAndResetMissCounters(s.ctx)
64-
validator, _ = s.app.StakingKeeper.GetValidator(s.ctx, valAddr)
64+
validator, _ = s.app.StakingKeeper.GetLiquidValidator(s.ctx, valAddr)
6565
s.Require().Equal(amt, validator.Tokens)
6666
s.Require().False(validator.Jailed)
6767

6868
// Case 4, slash jailed validator
69-
validator, _ = s.app.StakingKeeper.GetValidator(s.ctx, valAddr)
70-
validator.Status = stakingtypes.Bonded
69+
validator, _ = s.app.StakingKeeper.GetLiquidValidator(s.ctx, valAddr)
70+
validator.Status = sdkstaking.Bonded
7171
validator.Jailed = true
7272
validator.Tokens = amt
7373
s.app.StakingKeeper.SetValidator(s.ctx, validator)
7474

7575
s.app.OracleKeeper.SetMissCounter(s.ctx, valAddr, missCounterSlash)
7676
s.app.OracleKeeper.SlashAndResetMissCounters(s.ctx)
77-
validator, _ = s.app.StakingKeeper.GetValidator(s.ctx, valAddr)
77+
validator, _ = s.app.StakingKeeper.GetLiquidValidator(s.ctx, valAddr)
7878
s.Require().Equal(amt, validator.Tokens)
7979
}

x/oracle/testutil/test_helpers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
sdk "github.com/cosmos/cosmos-sdk/types"
77
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
88
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
9-
"github.com/cosmos/cosmos-sdk/x/staking"
10-
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
11-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
129
"github.com/persistenceOne/persistence-sdk/v2/simapp"
10+
"github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking"
11+
stakingkeeper "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/keeper"
12+
stakingtypes "github.com/persistenceOne/persistence-sdk/v2/x/lsnative/staking/types"
1313
"github.com/tendermint/tendermint/crypto/secp256k1"
1414
)
1515

@@ -97,7 +97,7 @@ func newTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey
9797

9898
msg, err := stakingtypes.NewMsgCreateValidator(
9999
address, pubKey, sdk.NewCoin(sdk.DefaultBondDenom, amt),
100-
stakingtypes.Description{}, commission, sdk.OneInt(),
100+
stakingtypes.Description{}, commission,
101101
)
102102
if err != nil {
103103
return nil, err

x/oracle/types/expected_keeper.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
sdk "github.com/cosmos/cosmos-sdk/types"
66
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
77
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
8-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
8+
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
99
)
1010

1111
// StakingKeeper defines the expected interface contract defined by the x/staking
1212
// module.
1313
type StakingKeeper interface {
14-
Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI
15-
GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
14+
Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI
15+
GetBondedValidatorsByPower(ctx sdk.Context) []sdkstaking.Validator
1616
TotalBondedTokens(sdk.Context) math.Int
1717
Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) math.Int
1818
Jail(sdk.Context, sdk.ConsAddress)
@@ -24,7 +24,7 @@ type StakingKeeper interface {
2424
// DistributionKeeper defines the expected interface contract defined by the
2525
// x/distribution module.
2626
type DistributionKeeper interface {
27-
AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins)
27+
AllocateTokensToValidator(ctx sdk.Context, val sdkstaking.ValidatorI, tokens sdk.DecCoins)
2828
GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins
2929
}
3030

x/oracle/types/utils_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
88
sdk "github.com/cosmos/cosmos-sdk/types"
9-
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
9+
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
1010
"github.com/tendermint/tendermint/crypto/secp256k1"
1111
tmprotocrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
1212
)
@@ -40,7 +40,7 @@ func (sk MockStakingKeeper) Validators() []MockValidator {
4040
return sk.validators
4141
}
4242

43-
func (sk MockStakingKeeper) Validator(_ sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI {
43+
func (sk MockStakingKeeper) Validator(_ sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI {
4444
for _, validator := range sk.validators {
4545
if validator.GetOperator().Equals(address) {
4646
return validator
@@ -54,7 +54,7 @@ func (MockStakingKeeper) TotalBondedTokens(sdk.Context) sdk.Int {
5454
return sdk.ZeroInt()
5555
}
5656

57-
func (MockStakingKeeper) GetBondedValidatorsByPower(sdk.Context) []stakingtypes.Validator {
57+
func (MockStakingKeeper) GetBondedValidatorsByPower(sdk.Context) []sdkstaking.Validator {
5858
return nil
5959
}
6060

@@ -101,8 +101,8 @@ func (MockValidator) GetMoniker() string {
101101
return ""
102102
}
103103

104-
func (MockValidator) GetStatus() stakingtypes.BondStatus {
105-
return stakingtypes.Bonded
104+
func (MockValidator) GetStatus() sdkstaking.BondStatus {
105+
return sdkstaking.Bonded
106106
}
107107

108108
func (MockValidator) IsBonded() bool {

0 commit comments

Comments
 (0)