Skip to content

Commit

Permalink
finalize rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mossid committed Oct 26, 2018
1 parent 3b3349c commit ab13269
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 68 deletions.
16 changes: 8 additions & 8 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (app *BaseApp) RegisterCodespace(codespace sdk.CodespaceType) sdk.Codespace
}

// Mount IAVL stores to the provided keys in the BaseApp multistore
func (app *BaseApp) MountStoresIAVL(keys ...*sdk.KVStoreKey) {
func (app *BaseApp) MountStoresIAVL(keys ...sdk.KVStoreKey) {
for _, key := range keys {
app.MountStore(key)
}
Expand All @@ -138,17 +138,17 @@ func (app *BaseApp) MountStoresTransient(keys ...*sdk.TransientStoreKey) {
}

// Mount a store to the provided key in the BaseApp multistore, using a specified DB
func (app *BaseApp) MountStoreWithDB(key sdk.StoreKey, db dbm.DB) {
app.cms.MountStoreWithDB(key, db)
func (app *BaseApp) MountStoreWithDB(key sdk.KVStoreKey, db dbm.DB) {
app.cms.MountKVStoreWithDB(key, db)
}

// Mount a store to the provided key in the BaseApp multistore, using the default DB
func (app *BaseApp) MountStore(key sdk.StoreKey) {
app.cms.MountStoreWithDB(key, nil)
func (app *BaseApp) MountStore(key sdk.KVStoreKey) {
app.cms.MountKVStoreWithDB(key, nil)
}

// load latest application version
func (app *BaseApp) LoadLatestVersion(mainKey sdk.StoreKey) error {
func (app *BaseApp) LoadLatestVersion(mainKey sdk.KVStoreKey) error {
err := app.cms.LoadLatestVersion()
if err != nil {
return err
Expand All @@ -157,7 +157,7 @@ func (app *BaseApp) LoadLatestVersion(mainKey sdk.StoreKey) error {
}

// load application version
func (app *BaseApp) LoadVersion(version int64, mainKey sdk.StoreKey) error {
func (app *BaseApp) LoadVersion(version int64, mainKey sdk.KVStoreKey) error {
err := app.cms.LoadMultiStoreVersion(version)
if err != nil {
return err
Expand All @@ -176,7 +176,7 @@ func (app *BaseApp) LastBlockHeight() int64 {
}

// initializes the remaining logic from app.cms
func (app *BaseApp) initFromStore(mainKey sdk.StoreKey) error {
func (app *BaseApp) initFromStore(mainKey sdk.KVStoreKey) error {
// main store should exist.
// TODO: we don't actually need the main store here
main := app.cms.GetKVStore(mainKey)
Expand Down
4 changes: 2 additions & 2 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func testTxDecoder(cdc *codec.Codec) sdk.TxDecoder {
}
}

func anteHandlerTxTest(t *testing.T, capKey *sdk.KVStoreKey, storeKey []byte) sdk.AnteHandler {
func anteHandlerTxTest(t *testing.T, capKey sdk.KVStoreKey, storeKey []byte) sdk.AnteHandler {
return func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, res sdk.Result, abort bool) {
store := ctx.KVStore(capKey)
msgCounter := tx.(txTest).Counter
Expand All @@ -375,7 +375,7 @@ func anteHandlerTxTest(t *testing.T, capKey *sdk.KVStoreKey, storeKey []byte) sd
}
}

func handlerMsgCounter(t *testing.T, capKey *sdk.KVStoreKey, deliverKey []byte) sdk.Handler {
func handlerMsgCounter(t *testing.T, capKey sdk.KVStoreKey, deliverKey []byte) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) sdk.Result {
store := ctx.KVStore(capKey)
var msgCount int64
Expand Down
18 changes: 9 additions & 9 deletions cmd/gaia/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ type GaiaApp struct {
cdc *codec.Codec

// keys to access the substores
keyMain *sdk.KVStoreKey
keyAccount *sdk.KVStoreKey
keyStake *sdk.KVStoreKey
keyMain sdk.KVStoreKey
keyAccount sdk.KVStoreKey
keyStake sdk.KVStoreKey
tkeyStake *sdk.TransientStoreKey
keySlashing *sdk.KVStoreKey
keyMint *sdk.KVStoreKey
keyDistr *sdk.KVStoreKey
keySlashing sdk.KVStoreKey
keyMint sdk.KVStoreKey
keyDistr sdk.KVStoreKey
tkeyDistr *sdk.TransientStoreKey
keyGov *sdk.KVStoreKey
keyFeeCollection *sdk.KVStoreKey
keyParams *sdk.KVStoreKey
keyGov sdk.KVStoreKey
keyFeeCollection sdk.KVStoreKey
keyParams sdk.KVStoreKey
tkeyParams *sdk.TransientStoreKey

// Manage getting and setting accounts
Expand Down
10 changes: 5 additions & 5 deletions cmd/gaia/cmd/gaiadebug/hack.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ type GaiaApp struct {
cdc *codec.Codec

// keys to access the substores
keyMain *sdk.KVStoreKey
keyAccount *sdk.KVStoreKey
keyStake *sdk.KVStoreKey
keyMain sdk.KVStoreKey
keyAccount sdk.KVStoreKey
keyStake sdk.KVStoreKey
tkeyStake *sdk.TransientStoreKey
keySlashing *sdk.KVStoreKey
keyParams *sdk.KVStoreKey
keySlashing sdk.KVStoreKey
keyParams sdk.KVStoreKey
tkeyParams *sdk.TransientStoreKey

// Manage getting and setting accounts
Expand Down
4 changes: 2 additions & 2 deletions x/auth/feekeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ var (
type FeeCollectionKeeper struct {

// The (unexposed) key used to access the fee store from the Context.
key sdk.StoreKey
key sdk.KVStoreKey

// The codec codec for binary encoding/decoding of accounts.
cdc *codec.Codec
}

func NewFeeCollectionKeeper(cdc *codec.Codec, key sdk.StoreKey) FeeCollectionKeeper {
func NewFeeCollectionKeeper(cdc *codec.Codec, key sdk.KVStoreKey) FeeCollectionKeeper {
return FeeCollectionKeeper{
key: key,
cdc: cdc,
Expand Down
4 changes: 2 additions & 2 deletions x/auth/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var globalAccountNumberKey = []byte("globalAccountNumber")
type AccountKeeper struct {

// The (unexposed) key used to access the store from the Context.
key sdk.StoreKey
key sdk.KVStoreKey

// The prototypical Account constructor.
proto func() Account
Expand All @@ -25,7 +25,7 @@ type AccountKeeper struct {
// NewAccountKeeper returns a new sdk.AccountKeeper that
// uses go-amino to (binary) encode and decode concrete sdk.Accounts.
// nolint
func NewAccountKeeper(cdc *codec.Codec, key sdk.StoreKey, proto func() Account) AccountKeeper {
func NewAccountKeeper(cdc *codec.Codec, key sdk.KVStoreKey, proto func() Account) AccountKeeper {
return AccountKeeper{
key: key,
proto: proto,
Expand Down
4 changes: 2 additions & 2 deletions x/distribution/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// keeper of the stake store
type Keeper struct {
storeKey sdk.StoreKey
storeKey sdk.KVStoreKey
cdc *codec.Codec
paramSpace params.Subspace
bankKeeper types.BankKeeper
Expand All @@ -20,7 +20,7 @@ type Keeper struct {
codespace sdk.CodespaceType
}

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSpace params.Subspace, ck types.BankKeeper,
func NewKeeper(cdc *codec.Codec, key sdk.KVStoreKey, paramSpace params.Subspace, ck types.BankKeeper,
sk types.StakeKeeper, fck types.FeeCollectionKeeper, codespace sdk.CodespaceType) Keeper {

keeper := Keeper{
Expand Down
14 changes: 7 additions & 7 deletions x/distribution/keeper/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func CreateTestInputAdvanced(t *testing.T, isCheckTx bool, initCoins int64,
db := dbm.NewMemDB()
ms := store.NewCommitMultiStore(db)

ms.MountStoreWithDB(keyDistr, db)
ms.MountStoreWithDB(tkeyStake, nil)
ms.MountStoreWithDB(keyStake, db)
ms.MountStoreWithDB(keyAcc, db)
ms.MountStoreWithDB(keyFeeCollection, db)
ms.MountStoreWithDB(keyParams, db)
ms.MountStoreWithDB(tkeyParams, db)
ms.MountKVStoreWithDB(keyDistr, db)
ms.MountKVStoreWithDB(tkeyStake, nil)
ms.MountKVStoreWithDB(keyStake, db)
ms.MountKVStoreWithDB(keyAcc, db)
ms.MountKVStoreWithDB(keyFeeCollection, db)
ms.MountKVStoreWithDB(keyParams, db)
ms.MountKVStoreWithDB(tkeyParams, db)

err := ms.LoadLatestVersion()
require.Nil(t, err)
Expand Down
4 changes: 2 additions & 2 deletions x/gov/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Keeper struct {
ds sdk.DelegationSet

// The (unexposed) keys used to access the stores from the Context.
storeKey sdk.StoreKey
storeKey sdk.KVStoreKey

// The codec codec for binary encoding/decoding.
cdc *codec.Codec
Expand All @@ -60,7 +60,7 @@ type Keeper struct {
// - depositing funds into proposals, and activating upon sufficient funds being deposited
// - users voting on proposals, with weight proportional to stake in the system
// - and tallying the result of the vote.
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramsKeeper params.Keeper, paramSpace params.Subspace, ck bank.Keeper, ds sdk.DelegationSet, codespace sdk.CodespaceType) Keeper {
func NewKeeper(cdc *codec.Codec, key sdk.KVStoreKey, paramsKeeper params.Keeper, paramSpace params.Subspace, ck bank.Keeper, ds sdk.DelegationSet, codespace sdk.CodespaceType) Keeper {
return Keeper{
storeKey: key,
paramsKeeper: paramsKeeper,
Expand Down
4 changes: 2 additions & 2 deletions x/mint/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (

// keeper of the stake store
type Keeper struct {
storeKey sdk.StoreKey
storeKey sdk.KVStoreKey
cdc *codec.Codec
paramSpace params.Subspace
sk StakeKeeper
fck FeeCollectionKeeper
}

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey,
func NewKeeper(cdc *codec.Codec, key sdk.KVStoreKey,
paramSpace params.Subspace, sk StakeKeeper, fck FeeCollectionKeeper) Keeper {

keeper := Keeper{
Expand Down
6 changes: 3 additions & 3 deletions x/mock/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const chainID = ""
type App struct {
*bam.BaseApp
Cdc *codec.Codec // Cdc is public since the codec is passed into the module anyways
KeyMain *sdk.KVStoreKey
KeyAccount *sdk.KVStoreKey
KeyMain sdk.KVStoreKey
KeyAccount sdk.KVStoreKey

// TODO: Abstract this out from not needing to be auth specifically
AccountKeeper auth.AccountKeeper
Expand Down Expand Up @@ -75,7 +75,7 @@ func NewApp() *App {

// CompleteSetup completes the application setup after the routes have been
// registered.
func (app *App) CompleteSetup(newKeys ...sdk.StoreKey) error {
func (app *App) CompleteSetup(newKeys ...sdk.KVStoreKey) error {
newKeys = append(newKeys, app.KeyMain)
newKeys = append(newKeys, app.KeyAccount)

Expand Down
6 changes: 3 additions & 3 deletions x/params/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
// Keeper of the global paramstore
type Keeper struct {
cdc *codec.Codec
key sdk.StoreKey
tkey sdk.StoreKey
key sdk.KVStoreKey
tkey sdk.KVStoreKey

spaces map[string]*Subspace
}

// NewKeeper constructs a params keeper
func NewKeeper(cdc *codec.Codec, key *sdk.KVStoreKey, tkey *sdk.TransientStoreKey) (k Keeper) {
func NewKeeper(cdc *codec.Codec, key sdk.KVStoreKey, tkey *sdk.TransientStoreKey) (k Keeper) {
k = Keeper{
cdc: cdc,
key: key,
Expand Down
6 changes: 3 additions & 3 deletions x/params/subspace/subspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import (
// recording whether the parameter has been changed or not
type Subspace struct {
cdc *codec.Codec
key sdk.StoreKey // []byte -> []byte, stores parameter
tkey sdk.StoreKey // []byte -> bool, stores parameter change
key sdk.KVStoreKey // []byte -> []byte, stores parameter
tkey sdk.KVStoreKey // []byte -> bool, stores parameter change

name []byte

table TypeTable
}

// NewSubspace constructs a store with namestore
func NewSubspace(cdc *codec.Codec, key sdk.StoreKey, tkey sdk.StoreKey, name string) (res Subspace) {
func NewSubspace(cdc *codec.Codec, key sdk.KVStoreKey, tkey sdk.KVStoreKey, name string) (res Subspace) {
res = Subspace{
cdc: cdc,
key: key,
Expand Down
4 changes: 2 additions & 2 deletions x/params/subspace/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func DefaultTestComponents(t *testing.T, table TypeTable) (sdk.Context, Subspace
tracer := ms.GetTracer()
tracer.SetWriter(os.Stdout)
tracer.SetContext(sdk.TraceContext{})
ms.MountStoreWithDB(key, db)
ms.MountStoreWithDB(tkey, db)
ms.MountKVStoreWithDB(key, db)
ms.MountKVStoreWithDB(tkey, db)
err := ms.LoadLatestVersion()
require.Nil(t, err)
ctx := sdk.NewContext(ms, abci.Header{}, false, log.NewTMLogger(os.Stdout))
Expand Down
4 changes: 2 additions & 2 deletions x/slashing/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

// Keeper of the slashing store
type Keeper struct {
storeKey sdk.StoreKey
storeKey sdk.KVStoreKey
cdc *codec.Codec
validatorSet sdk.ValidatorSet
paramspace params.Subspace
Expand All @@ -26,7 +26,7 @@ type Keeper struct {
}

// NewKeeper creates a slashing keeper
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, vs sdk.ValidatorSet, paramspace params.Subspace, codespace sdk.CodespaceType) Keeper {
func NewKeeper(cdc *codec.Codec, key sdk.KVStoreKey, vs sdk.ValidatorSet, paramspace params.Subspace, codespace sdk.CodespaceType) Keeper {
keeper := Keeper{
storeKey: key,
cdc: cdc,
Expand Down
12 changes: 6 additions & 6 deletions x/slashing/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ func createTestInput(t *testing.T, defaults Params) (sdk.Context, bank.Keeper, s
tkeyParams := sdk.NewTransientStoreKey("transient_params")
db := dbm.NewMemDB()
ms := store.NewCommitMultiStore(db)
ms.MountStoreWithDB(keyAcc, db)
ms.MountStoreWithDB(tkeyStake, nil)
ms.MountStoreWithDB(keyStake, db)
ms.MountStoreWithDB(keySlashing, db)
ms.MountStoreWithDB(keyParams, db)
ms.MountStoreWithDB(tkeyParams, db)
ms.MountKVStoreWithDB(keyAcc, db)
ms.MountKVStoreWithDB(tkeyStake, nil)
ms.MountKVStoreWithDB(keyStake, db)
ms.MountKVStoreWithDB(keySlashing, db)
ms.MountKVStoreWithDB(keyParams, db)
ms.MountKVStoreWithDB(tkeyParams, db)
err := ms.LoadLatestVersion()
require.Nil(t, err)

Expand Down
6 changes: 3 additions & 3 deletions x/stake/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

// keeper of the stake store
type Keeper struct {
storeKey sdk.StoreKey
storeTKey sdk.StoreKey
storeKey sdk.KVStoreKey
storeTKey sdk.KVStoreKey
cdc *codec.Codec
bankKeeper bank.Keeper
hooks sdk.StakingHooks
Expand All @@ -22,7 +22,7 @@ type Keeper struct {
codespace sdk.CodespaceType
}

func NewKeeper(cdc *codec.Codec, key, tkey sdk.StoreKey, ck bank.Keeper, paramstore params.Subspace, codespace sdk.CodespaceType) Keeper {
func NewKeeper(cdc *codec.Codec, key, tkey sdk.KVStoreKey, ck bank.Keeper, paramstore params.Subspace, codespace sdk.CodespaceType) Keeper {
keeper := Keeper{
storeKey: key,
storeTKey: tkey,
Expand Down
10 changes: 5 additions & 5 deletions x/stake/keeper/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ func CreateTestInput(t *testing.T, isCheckTx bool, initCoins int64) (sdk.Context

db := dbm.NewMemDB()
ms := rootmulti.NewStore(db)
ms.MountStoreWithDB(tkeyStake, nil)
ms.MountStoreWithDB(keyStake, db)
ms.MountStoreWithDB(keyAcc, db)
ms.MountStoreWithDB(keyParams, db)
ms.MountStoreWithDB(tkeyParams, db)
ms.MountKVStoreWithDB(tkeyStake, nil)
ms.MountKVStoreWithDB(keyStake, db)
ms.MountKVStoreWithDB(keyAcc, db)
ms.MountKVStoreWithDB(keyParams, db)
ms.MountKVStoreWithDB(tkeyParams, db)
err := ms.LoadLatestVersion()
require.Nil(t, err)

Expand Down

0 comments on commit ab13269

Please sign in to comment.