standardise pricefeed NewKeeper

This commit is contained in:
rhuairahrighairigh 2019-12-03 14:32:01 +00:00
parent fc2b7f9652
commit e83127a15e
3 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ func setupTestKeepers() (sdk.Context, keepers) {
bank.DefaultCodespace, bank.DefaultCodespace,
blacklistedAddrs, blacklistedAddrs,
) )
pricefeedKeeper := pricefeed.NewKeeper(keyPriceFeed, cdc, paramsKeeper.Subspace(pricefeed.DefaultParamspace).WithKeyTable(pricefeed.ParamKeyTable()), pricefeed.DefaultCodespace) pricefeedKeeper := pricefeed.NewKeeper(cdc, keyPriceFeed, paramsKeeper.Subspace(pricefeed.DefaultParamspace).WithKeyTable(pricefeed.ParamKeyTable()), pricefeed.DefaultCodespace)
cdpKeeper := cdp.NewKeeper( cdpKeeper := cdp.NewKeeper(
cdc, cdc,
keyCDP, keyCDP,

View File

@ -44,7 +44,7 @@ type Keeper struct {
// - adding oracles // - adding oracles
// - adding/removing assets from the pricefeed // - adding/removing assets from the pricefeed
func NewKeeper( func NewKeeper(
storeKey sdk.StoreKey, cdc *codec.Codec, paramSpace ParamSubspace, codespace sdk.CodespaceType, cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace ParamSubspace, codespace sdk.CodespaceType,
) Keeper { ) Keeper {
return Keeper{ return Keeper{
paramSpace: paramSpace, paramSpace: paramSpace,

View File

@ -24,7 +24,7 @@ func getMockApp(t *testing.T, numGenAccs int, genState GenesisState, genAccs []a
RegisterCodec(mApp.Cdc) RegisterCodec(mApp.Cdc)
keyPricefeed := sdk.NewKVStoreKey(StoreKey) keyPricefeed := sdk.NewKVStoreKey(StoreKey)
pk := mApp.ParamsKeeper pk := mApp.ParamsKeeper
keeper := NewKeeper(keyPricefeed, mApp.Cdc, pk.Subspace(DefaultParamspace).WithKeyTable(ParamKeyTable()), DefaultCodespace) keeper := NewKeeper(mApp.Cdc, keyPricefeed, pk.Subspace(DefaultParamspace).WithKeyTable(ParamKeyTable()), DefaultCodespace)
// Register routes // Register routes
mApp.Router().AddRoute(RouterKey, NewHandler(keeper)) mApp.Router().AddRoute(RouterKey, NewHandler(keeper))