renamed staking to simplestake

This commit is contained in:
Sunny Aggarwal 2018-03-29 06:33:45 +02:00
parent 2e5943e1bf
commit 9d9001ab62
11 changed files with 19 additions and 16 deletions

2
Gopkg.lock generated
View File

@ -458,6 +458,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "cce90fda84a63ae5b41b40f0edc357eec4020d17fdd61585960ad537418749ea"
inputs-digest = "ed1f3f7f1728cd02945f90ca780e9bdc982573a36a5cc8d7e9f19fb40ba2ca19"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -15,7 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/ibc"
"github.com/cosmos/cosmos-sdk/x/staking"
simplestake "github.com/cosmos/cosmos-sdk/x/simplestake"
"github.com/cosmos/cosmos-sdk/examples/basecoin/types"
"github.com/cosmos/cosmos-sdk/examples/basecoin/x/cool"
@ -47,7 +47,7 @@ func NewBasecoinApp(logger log.Logger, db dbm.DB) *BasecoinApp {
cdc: MakeCodec(),
capKeyMainStore: sdk.NewKVStoreKey("main"),
capKeyIBCStore: sdk.NewKVStoreKey("ibc"),
capKeyStakingStore: sdk.NewKVStoreKey("staking"),
capKeyStakingStore: sdk.NewKVStoreKey("stake"),
}
// define the accountMapper
@ -60,13 +60,13 @@ func NewBasecoinApp(logger log.Logger, db dbm.DB) *BasecoinApp {
coinKeeper := bank.NewCoinKeeper(app.accountMapper)
coolKeeper := cool.NewKeeper(app.capKeyMainStore, coinKeeper)
ibcMapper := ibc.NewIBCMapper(app.cdc, app.capKeyIBCStore)
stakeKeeper := staking.NewKeeper(app.capKeyStakingStore, coinKeeper)
stakeKeeper := simplestake.NewKeeper(app.capKeyStakingStore, coinKeeper)
app.Router().
AddRoute("bank", bank.NewHandler(coinKeeper), nil).
AddRoute("cool", cool.NewHandler(coolKeeper), coolKeeper.InitGenesis).
AddRoute("sketchy", sketchy.NewHandler(), nil).
AddRoute("ibc", ibc.NewHandler(ibcMapper, coinKeeper), nil).
AddRoute("staking", staking.NewHandler(stakeKeeper), nil)
AddRoute("simplestake", simplestake.NewHandler(stakeKeeper), nil)
// initialize BaseApp
app.SetTxDecoder(app.txDecoder)
@ -100,8 +100,8 @@ func MakeCodec() *wire.Codec {
oldwire.ConcreteType{cool.SetTrendMsg{}, msgTypeSetTrend},
oldwire.ConcreteType{ibc.IBCTransferMsg{}, msgTypeIBCTransferMsg},
oldwire.ConcreteType{ibc.IBCReceiveMsg{}, msgTypeIBCReceiveMsg},
oldwire.ConcreteType{staking.BondMsg{}, msgTypeBondMsg},
oldwire.ConcreteType{staking.UnbondMsg{}, msgTypeUnbondMsg},
oldwire.ConcreteType{simplestake.BondMsg{}, msgTypeBondMsg},
oldwire.ConcreteType{simplestake.UnbondMsg{}, msgTypeUnbondMsg},
)
const accTypeApp = 0x1

View File

@ -2,9 +2,10 @@ package main
import (
"errors"
"github.com/spf13/cobra"
"os"
"github.com/spf13/cobra"
"github.com/tendermint/tmlibs/cli"
"github.com/cosmos/cosmos-sdk/client"
@ -18,7 +19,7 @@ import (
authcmd "github.com/cosmos/cosmos-sdk/x/auth/commands"
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/commands"
ibccmd "github.com/cosmos/cosmos-sdk/x/ibc/commands"
stakingcmd "github.com/cosmos/cosmos-sdk/x/staking/commands"
simplestakingcmd "github.com/cosmos/cosmos-sdk/x/simplestake/commands"
"github.com/cosmos/cosmos-sdk/examples/basecoin/app"
"github.com/cosmos/cosmos-sdk/examples/basecoin/types"
@ -77,11 +78,11 @@ func main() {
basecliCmd.AddCommand(
client.PostCommands(
ibccmd.IBCRelayCmd(cdc),
stakingcmd.BondTxCmd(cdc),
simplestakingcmd.BondTxCmd(cdc),
)...)
basecliCmd.AddCommand(
client.PostCommands(
stakingcmd.UnbondTxCmd(cdc),
simplestakingcmd.UnbondTxCmd(cdc),
)...)
// add proxy, version and key info

View File

@ -13,7 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/builder"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/wire"
"github.com/cosmos/cosmos-sdk/x/staking"
simplestake "github.com/cosmos/cosmos-sdk/x/simplestake"
)
const (
@ -76,7 +76,7 @@ func (co commander) bondTxCmd(cmd *cobra.Command, args []string) error {
var pubKeyEd crypto.PubKeyEd25519
copy(pubKeyEd[:], rawPubKey)
msg := staking.NewBondMsg(from, stake, pubKeyEd.Wrap())
msg := simplestake.NewBondMsg(from, stake, pubKeyEd.Wrap())
return co.sendMsg(msg)
}
@ -87,7 +87,7 @@ func (co commander) unbondTxCmd(cmd *cobra.Command, args []string) error {
return err
}
msg := staking.NewUnbondMsg(from)
msg := simplestake.NewUnbondMsg(from)
return co.sendMsg(msg)
}

View File

@ -10,6 +10,8 @@ import (
const stakingToken = "steak"
const moduleName = "simplestake"
type Keeper struct {
ck bank.CoinKeeper

View File

@ -26,7 +26,7 @@ func NewBondMsg(addr sdk.Address, stake sdk.Coin, pubKey crypto.PubKey) BondMsg
}
func (msg BondMsg) Type() string {
return "staking"
return moduleName
}
func (msg BondMsg) ValidateBasic() sdk.Error {
@ -71,7 +71,7 @@ func NewUnbondMsg(addr sdk.Address) UnbondMsg {
}
func (msg UnbondMsg) Type() string {
return "staking"
return moduleName
}
func (msg UnbondMsg) ValidateBasic() sdk.Error {