Update to latest go-crypto, adjust code and tests

This commit is contained in:
Ethan Frey
2017-04-27 15:53:49 +02:00
parent 787cf0ebac
commit b6ebf9f8b8
11 changed files with 39 additions and 49 deletions
+3 -3
View File
@@ -62,9 +62,9 @@ func (a *Address) UnmarshalJSON(addrHex []byte) error {
}
type Key struct {
Address Address `json:"address"`
PubKey crypto.PubKeyS `json:"pub_key"`
PrivKey crypto.PrivKeyS `json:"priv_key"`
Address Address `json:"address"`
PubKey crypto.PubKey `json:"pub_key"`
PrivKey crypto.PrivKey `json:"priv_key"`
}
// Implements Signer
+2 -3
View File
@@ -8,7 +8,6 @@ import (
"github.com/spf13/cobra"
"github.com/tendermint/basecoin/types"
crypto "github.com/tendermint/go-crypto"
client "github.com/tendermint/go-rpc/client"
wire "github.com/tendermint/go-wire"
@@ -123,7 +122,7 @@ func sendTxCmd(cmd *cobra.Command, args []string) error {
// sign that puppy
signBytes := tx.SignBytes(chainIDFlag)
tx.Inputs[0].Signature = crypto.WrapSignature(privKey.Sign(signBytes))
tx.Inputs[0].Signature = privKey.Sign(signBytes)
fmt.Println("Signed SendTx:")
fmt.Println(string(wire.JSONBytes(tx)))
@@ -179,7 +178,7 @@ func AppTx(name string, data []byte) error {
Data: data,
}
tx.Input.Signature = crypto.WrapSignature(privKey.Sign(tx.SignBytes(chainIDFlag)))
tx.Input.Signature = privKey.Sign(tx.SignBytes(chainIDFlag))
fmt.Println("Signed AppTx:")
fmt.Println(string(wire.JSONBytes(tx)))