Merge pull request #821 from cosmos/adrian/deadcode

Remove deadcode
This commit is contained in:
Rigel 2018-04-09 20:34:50 -04:00 committed by GitHub
commit e588ebfa9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 28 deletions

View File

@ -7,12 +7,10 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/wire"
"github.com/cosmos/cosmos-sdk/x/bank"
cryptokeys "github.com/tendermint/go-crypto/keys"
)
const (
@ -80,29 +78,3 @@ func BuildMsg(from sdk.Address, to sdk.Address, coins sdk.Coins) sdk.Msg {
msg := bank.NewSendMsg([]bank.Input{input}, []bank.Output{output})
return msg
}
func (c Commander) SignMessage(msg sdk.Msg, kb cryptokeys.Keybase, accountName string, password string) ([]byte, error) {
// sign and build
bz := msg.GetSignBytes()
sig, pubkey, err := kb.Sign(accountName, password, bz)
if err != nil {
return nil, err
}
sigs := []sdk.StdSignature{{
PubKey: pubkey,
Signature: sig,
Sequence: viper.GetInt64(client.FlagName),
}}
// TODO: fees
var fee sdk.StdFee
// marshal bytes
tx := sdk.NewStdTx(msg, fee, sigs)
txBytes, err := c.Cdc.MarshalBinary(tx)
if err != nil {
return nil, err
}
return txBytes, nil
}