From 10a22f20ba4b09e9297365ab68f42b4087fa02de Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Fri, 30 Mar 2018 16:27:26 +0200 Subject: [PATCH] Remove 'cool' and 'sketchy' modules from basecoind --- client/lcd/lcd_test.go | 3 -- examples/basecoin/app/app.go | 7 ---- examples/basecoin/app/app_test.go | 55 --------------------------- examples/basecoin/cmd/basecli/main.go | 9 ----- x/ibc/ibc_test.go | 4 -- 5 files changed, 78 deletions(-) diff --git a/client/lcd/lcd_test.go b/client/lcd/lcd_test.go index c9b1bb9bd8..9a3900759d 100644 --- a/client/lcd/lcd_test.go +++ b/client/lcd/lcd_test.go @@ -364,9 +364,6 @@ func startTMAndLCD() (*nm.Node, net.Listener, error) { Coins: coins, }, }, - "cool": map[string]string{ - "trend": "ice-cold", - }, } stateBytes, err := json.Marshal(appState) if err != nil { diff --git a/examples/basecoin/app/app.go b/examples/basecoin/app/app.go index 18ac89131e..7c737566a7 100644 --- a/examples/basecoin/app/app.go +++ b/examples/basecoin/app/app.go @@ -18,8 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/simplestake" "github.com/cosmos/cosmos-sdk/examples/basecoin/types" - "github.com/cosmos/cosmos-sdk/examples/basecoin/x/cool" - "github.com/cosmos/cosmos-sdk/examples/basecoin/x/sketchy" ) const ( @@ -60,13 +58,10 @@ func NewBasecoinApp(logger log.Logger, dbs map[string]dbm.DB) *BasecoinApp { // add handlers coinKeeper := bank.NewCoinKeeper(app.accountMapper) - coolKeeper := cool.NewKeeper(app.capKeyMainStore, coinKeeper) ibcMapper := ibc.NewIBCMapper(app.cdc, app.capKeyIBCStore) 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("simplestake", simplestake.NewHandler(stakeKeeper), nil) @@ -103,8 +98,6 @@ func MakeCodec() *wire.Codec { struct{ sdk.Msg }{}, oldwire.ConcreteType{bank.SendMsg{}, msgTypeSend}, oldwire.ConcreteType{bank.IssueMsg{}, msgTypeIssue}, - oldwire.ConcreteType{cool.QuizMsg{}, msgTypeQuiz}, - oldwire.ConcreteType{cool.SetTrendMsg{}, msgTypeSetTrend}, oldwire.ConcreteType{ibc.IBCTransferMsg{}, msgTypeIBCTransferMsg}, oldwire.ConcreteType{ibc.IBCReceiveMsg{}, msgTypeIBCReceiveMsg}, oldwire.ConcreteType{simplestake.BondMsg{}, msgTypeBondMsg}, diff --git a/examples/basecoin/app/app_test.go b/examples/basecoin/app/app_test.go index c60092874f..144374f3f5 100644 --- a/examples/basecoin/app/app_test.go +++ b/examples/basecoin/app/app_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/examples/basecoin/types" - "github.com/cosmos/cosmos-sdk/examples/basecoin/x/cool" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" @@ -39,31 +38,6 @@ var ( Inputs: []bank.Input{bank.NewInput(addr1, coins)}, Outputs: []bank.Output{bank.NewOutput(addr2, coins)}, } - - quizMsg1 = cool.QuizMsg{ - Sender: addr1, - CoolAnswer: "icecold", - } - - quizMsg2 = cool.QuizMsg{ - Sender: addr1, - CoolAnswer: "badvibesonly", - } - - setTrendMsg1 = cool.SetTrendMsg{ - Sender: addr1, - Cool: "icecold", - } - - setTrendMsg2 = cool.SetTrendMsg{ - Sender: addr1, - Cool: "badvibesonly", - } - - setTrendMsg3 = cool.SetTrendMsg{ - Sender: addr1, - Cool: "warmandkind", - } ) func loggerAndDBs() (log.Logger, map[string]dbm.DB) { @@ -91,8 +65,6 @@ func TestMsgs(t *testing.T) { msg sdk.Msg }{ {sendMsg}, - {quizMsg1}, - {setTrendMsg1}, } sequences := []int64{0} @@ -140,9 +112,6 @@ func TestGenesis(t *testing.T) { "accounts": []*types.GenesisAccount{ types.NewGenesisAccount(acc), }, - "cool": map[string]string{ - "trend": "ice-cold", - }, } stateBytes, err := json.MarshalIndent(genesisState, "", "\t") @@ -180,9 +149,6 @@ func TestSendMsgWithAccounts(t *testing.T) { "accounts": []*types.GenesisAccount{ types.NewGenesisAccount(acc1), }, - "cool": map[string]string{ - "trend": "ice-cold", - }, } stateBytes, err := json.MarshalIndent(genesisState, "", "\t") require.Nil(t, err) @@ -255,9 +221,6 @@ func TestQuizMsg(t *testing.T) { "accounts": []*types.GenesisAccount{ types.NewGenesisAccount(acc1), }, - "cool": map[string]string{ - "trend": "ice-cold", - }, } stateBytes, err := json.MarshalIndent(genesisState, "", "\t") require.Nil(t, err) @@ -272,21 +235,6 @@ func TestQuizMsg(t *testing.T) { res1 := bapp.accountMapper.GetAccount(ctxCheck, addr1) assert.Equal(t, acc1, res1) - // Set the trend, submit a really cool quiz and check for reward - SignCheckDeliver(t, bapp, setTrendMsg1, 0, true) - SignCheckDeliver(t, bapp, quizMsg1, 1, true) - CheckBalance(t, bapp, "69icecold") - SignCheckDeliver(t, bapp, quizMsg2, 2, false) // result without reward - CheckBalance(t, bapp, "69icecold") - SignCheckDeliver(t, bapp, quizMsg1, 3, true) - CheckBalance(t, bapp, "138icecold") - SignCheckDeliver(t, bapp, setTrendMsg2, 4, true) // reset the trend - SignCheckDeliver(t, bapp, quizMsg1, 5, false) // the same answer will nolonger do! - CheckBalance(t, bapp, "138icecold") - SignCheckDeliver(t, bapp, quizMsg2, 6, true) // earlier answer now relavent again - CheckBalance(t, bapp, "69badvibesonly,138icecold") - SignCheckDeliver(t, bapp, setTrendMsg3, 7, false) // expect to fail to set the trend to something which is not cool - } func TestHandler(t *testing.T) { @@ -305,9 +253,6 @@ func TestHandler(t *testing.T) { "accounts": []*types.GenesisAccount{ types.NewGenesisAccount(acc1), }, - "cool": map[string]string{ - "trend": "ice-cold", - }, } stateBytes, err := json.MarshalIndent(genesisState, "", "\t") require.Nil(t, err) diff --git a/examples/basecoin/cmd/basecli/main.go b/examples/basecoin/cmd/basecli/main.go index 1c4b5833bf..a0152aee99 100644 --- a/examples/basecoin/cmd/basecli/main.go +++ b/examples/basecoin/cmd/basecli/main.go @@ -14,7 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/tx" - coolcmd "github.com/cosmos/cosmos-sdk/examples/basecoin/x/cool/commands" "github.com/cosmos/cosmos-sdk/version" authcmd "github.com/cosmos/cosmos-sdk/x/auth/commands" bankcmd "github.com/cosmos/cosmos-sdk/x/bank/commands" @@ -63,14 +62,6 @@ func main() { client.PostCommands( bankcmd.SendTxCmd(cdc), )...) - basecliCmd.AddCommand( - client.PostCommands( - coolcmd.QuizTxCmd(cdc), - )...) - basecliCmd.AddCommand( - client.PostCommands( - coolcmd.SetTrendTxCmd(cdc), - )...) basecliCmd.AddCommand( client.PostCommands( ibccmd.IBCTransferCmd(cdc), diff --git a/x/ibc/ibc_test.go b/x/ibc/ibc_test.go index bec08fb564..1e04311479 100644 --- a/x/ibc/ibc_test.go +++ b/x/ibc/ibc_test.go @@ -15,8 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/wire" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" - - "github.com/cosmos/cosmos-sdk/examples/basecoin/x/cool" ) // AccountMapper(/CoinKeeper) and IBCMapper should use different StoreKey later @@ -53,8 +51,6 @@ func makeCodec() *wire.Codec { struct{ sdk.Msg }{}, oldwire.ConcreteType{bank.SendMsg{}, msgTypeSend}, oldwire.ConcreteType{bank.IssueMsg{}, msgTypeIssue}, - oldwire.ConcreteType{cool.QuizMsg{}, msgTypeQuiz}, - oldwire.ConcreteType{cool.SetTrendMsg{}, msgTypeSetTrend}, oldwire.ConcreteType{IBCTransferMsg{}, msgTypeIBCTransferMsg}, oldwire.ConcreteType{IBCReceiveMsg{}, msgTypeIBCReceiveMsg}, )