Fixed all imports in keys

This commit is contained in:
Ethan Frey
2017-04-19 17:25:53 +02:00
parent 0bfae964e1
commit 91bd7efb7b
13 changed files with 24 additions and 25 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ package tx
import (
"github.com/pkg/errors"
crypto "github.com/tendermint/go-crypto"
data "github.com/tendermint/go-data"
data "github.com/tendermint/go-wire/data"
)
// MultiSig lets us wrap arbitrary data with a go-crypto signature
@@ -16,8 +16,8 @@ type MultiSig struct {
}
type Signed struct {
Sig crypto.SignatureS
Pubkey crypto.PubKeyS
Sig crypto.Signature
Pubkey crypto.PubKey
}
var _ SigInner = &MultiSig{}
@@ -36,12 +36,12 @@ func (s *MultiSig) SignBytes() []byte {
// Depending on the Signable, one may be able to call this multiple times for multisig
// Returns error if called with invalid data or too many times
func (s *MultiSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error {
if pubkey == nil || sig == nil {
if pubkey.Empty() || sig.Empty() {
return errors.New("Signature or Key missing")
}
// set the value once we are happy
x := Signed{crypto.SignatureS{sig}, crypto.PubKeyS{pubkey}}
x := Signed{sig, pubkey}
s.Sigs = append(s.Sigs, x)
return nil
}
+3 -4
View File
@@ -3,7 +3,7 @@ package tx
import (
"github.com/pkg/errors"
crypto "github.com/tendermint/go-crypto"
data "github.com/tendermint/go-data"
data "github.com/tendermint/go-wire/data"
)
// OneSig lets us wrap arbitrary data with a go-crypto signature
@@ -31,7 +31,7 @@ func (s *OneSig) SignBytes() []byte {
// Depending on the Signable, one may be able to call this multiple times for multisig
// Returns error if called with invalid data or too many times
func (s *OneSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error {
if pubkey == nil || sig == nil {
if pubkey.Empty() || sig.Empty() {
return errors.New("Signature or Key missing")
}
if !s.Sig.Empty() {
@@ -39,8 +39,7 @@ func (s *OneSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error {
}
// set the value once we are happy
s.Pubkey = crypto.PubKeyS{pubkey}
s.Sig = crypto.SignatureS{sig}
s.Signed = Signed{sig, pubkey}
return nil
}
+3 -3
View File
@@ -2,8 +2,8 @@ package tx
import (
crypto "github.com/tendermint/go-crypto"
data "github.com/tendermint/go-data"
keys "github.com/tendermint/go-crypto/keys"
data "github.com/tendermint/go-wire/data"
)
const (
@@ -18,8 +18,8 @@ var TxMapper data.Mapper
func init() {
TxMapper = data.NewMapper(Sig{}).
RegisterInterface(&OneSig{}, nameOneSig, typeOneSig).
RegisterInterface(&MultiSig{}, nameMultiSig, typeMultiSig)
RegisterImplementation(&OneSig{}, nameOneSig, typeOneSig).
RegisterImplementation(&MultiSig{}, nameMultiSig, typeMultiSig)
}
/*
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
crypto "github.com/tendermint/go-crypto"
data "github.com/tendermint/go-data"
data "github.com/tendermint/go-wire/data"
"github.com/tendermint/go-crypto/keys/cryptostore"
"github.com/tendermint/go-crypto/keys/storage/memstorage"
)