Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes committed Apr 30, 2018
1 parent 339c02a commit a658994
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 38 deletions.
13 changes: 6 additions & 7 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,12 @@ type testUpdatePowerTx struct {

const msgType = "testUpdatePowerTx"

func (tx testUpdatePowerTx) Type() string { return msgType }
func (tx testUpdatePowerTx) Get(key interface{}) (value interface{}) { return nil }
func (tx testUpdatePowerTx) GetMsg() sdk.Msg { return tx }
func (tx testUpdatePowerTx) GetSignBytes() []byte { return nil }
func (tx testUpdatePowerTx) ValidateBasic() sdk.Error { return nil }
func (tx testUpdatePowerTx) GetSigners() []sdk.Address { return nil }
func (tx testUpdatePowerTx) GetSignatures() []sdk.StdSignature { return nil }
func (tx testUpdatePowerTx) Type() string { return msgType }
func (tx testUpdatePowerTx) GetMsg() sdk.Msg { return tx }
func (tx testUpdatePowerTx) GetSignBytes() []byte { return nil }
func (tx testUpdatePowerTx) ValidateBasic() sdk.Error { return nil }
func (tx testUpdatePowerTx) GetSigners() []sdk.Address { return nil }
func (tx testUpdatePowerTx) GetSignatures() []sdk.StdSignature { return nil }

func TestValidatorChange(t *testing.T) {

Expand Down
5 changes: 2 additions & 3 deletions examples/democoin/x/simplestake/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ func NewMsgBond(addr sdk.Address, stake sdk.Coin, pubKey crypto.PubKey) MsgBond
}

//nolint
func (msg MsgBond) Type() string { return moduleName } //TODO update "stake/declarecandidacy"
func (msg MsgBond) Get(key interface{}) (value interface{}) { return nil }
func (msg MsgBond) GetSigners() []sdk.Address { return []sdk.Address{msg.Address} }
func (msg MsgBond) Type() string { return moduleName } //TODO update "stake/declarecandidacy"
func (msg MsgBond) GetSigners() []sdk.Address { return []sdk.Address{msg.Address} }

// basic validation of the bond message
func (msg MsgBond) ValidateBasic() sdk.Error {
Expand Down
13 changes: 0 additions & 13 deletions examples/kvstore/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ type kvstoreTx struct {
bytes []byte
}

func (tx kvstoreTx) Get(key interface{}) (value interface{}) {
switch k := key.(type) {
case string:
switch k {
case "key":
return tx.key
case "value":
return tx.value
}
}
return nil
}

func (tx kvstoreTx) Type() string {
return "kvstore"
}
Expand Down
13 changes: 0 additions & 13 deletions mock/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,6 @@ func NewTx(key, value string) kvstoreTx {
}
}

func (tx kvstoreTx) Get(key interface{}) (value interface{}) {
switch k := key.(type) {
case string:
switch k {
case "key":
return tx.key
case "value":
return tx.value
}
}
return nil
}

func (tx kvstoreTx) Type() string {
return "kvstore"
}
Expand Down
3 changes: 1 addition & 2 deletions types/tx_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ func NewTestMsg(addrs ...Address) *TestMsg {
}

//nolint
func (msg *TestMsg) Type() string { return "TestMsg" }
func (msg *TestMsg) Get(key interface{}) (value interface{}) { return nil }
func (msg *TestMsg) Type() string { return "TestMsg" }
func (msg *TestMsg) GetSignBytes() []byte {
bz, err := json.Marshal(msg.signers)
if err != nil {
Expand Down

0 comments on commit a658994

Please sign in to comment.