Skip to content

Commit

Permalink
fix: update according to sdk v46 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeet97 authored and xlab committed Apr 14, 2023
1 parent 7787cdf commit ac343b9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion x/oracle/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var (
)

func (s *KeeperTestSuite) TestOracleExportGenesis() {
app := simapp.Setup(false)
app := simapp.Setup(s.T(), false)
ctx := app.BaseApp.NewContext(false, tmproto.Header{})

genesisState := oracle.ExportGenesis(ctx, app.OracleKeeper)
Expand Down
5 changes: 3 additions & 2 deletions x/oracle/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"

"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand All @@ -18,7 +19,7 @@ import (
// Keeper of the oracle store
type Keeper struct {
cdc codec.BinaryCodec
storeKey sdk.StoreKey
storeKey storetypes.StoreKey
paramSpace paramstypes.Subspace

accountKeeper types.AccountKeeper
Expand All @@ -32,7 +33,7 @@ type Keeper struct {
// NewKeeper constructs a new keeper for oracle
func NewKeeper(
cdc codec.BinaryCodec,
storeKey sdk.StoreKey,
storeKey storetypes.StoreKey,
paramSpace paramstypes.Subspace,
accountKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (s *KeeperTestSuite) SetupTest() {
}

func (s *KeeperTestSuite) initAppAndContext() (app *persistenceapp.SimApp, ctx sdk.Context) {
app = persistenceapp.Setup(false)
app = persistenceapp.Setup(s.T(), false)
ctx = app.BaseApp.NewContext(false, tmproto.Header{
Height: initialHeight,
Time: tmtime.Now(),
Expand Down
7 changes: 4 additions & 3 deletions x/oracle/testutil/test_helpers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testutil

import (
"cosmossdk.io/math"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -54,7 +55,7 @@ func StakingAddValidators(
) {
accAddresses := make([]sdk.AccAddress, num)
valAddresses := make([]sdk.ValAddress, num)
stakingHandler := staking.NewHandler(stakingKeeper)
stakingMsgServer := stakingkeeper.NewMsgServerImpl(stakingKeeper)

valPubKeys := simapp.CreateTestPubKeys(num)

Expand All @@ -77,7 +78,7 @@ func StakingAddValidators(
return nil, nil, err
}

if _, err := stakingHandler(ctx, createValidatorMsg); err != nil {
if _, err := stakingMsgServer.CreateValidator(ctx, createValidatorMsg); err != nil {
return nil, nil, err
}

Expand All @@ -91,7 +92,7 @@ func StakingAddValidators(
return accAddresses, valAddresses, nil
}

func newTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdk.Int) (*stakingtypes.MsgCreateValidator, error) {
func newTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt math.Int) (*stakingtypes.MsgCreateValidator, error) {
commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec())

msg, err := stakingtypes.NewMsgCreateValidator(
Expand Down
7 changes: 4 additions & 3 deletions x/oracle/types/expected_keeper.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand All @@ -12,12 +13,12 @@ import (
type StakingKeeper interface {
Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI
GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
TotalBondedTokens(sdk.Context) sdk.Int
Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
TotalBondedTokens(sdk.Context) math.Int
Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) math.Int
Jail(sdk.Context, sdk.ConsAddress)
ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator
MaxValidators(sdk.Context) uint32
PowerReduction(ctx sdk.Context) (res sdk.Int)
PowerReduction(ctx sdk.Context) (res math.Int)
}

// DistributionKeeper defines the expected interface contract defined by the
Expand Down

0 comments on commit ac343b9

Please sign in to comment.