diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index f103beae..6be23c8b 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -9,7 +9,6 @@ import ( . "github.com/tendermint/go-common" cfg "github.com/tendermint/go-config" - "github.com/tendermint/go-crypto" "github.com/tendermint/go-events" "github.com/tendermint/go-p2p" "github.com/tendermint/tendermint/types" @@ -259,7 +258,7 @@ func (privVal *ByzantinePrivValidator) SignVote(chainID string, vote *types.Vote defer privVal.mtx.Unlock() // Sign - vote.Signature = privVal.Sign(types.SignBytes(chainID, vote)).(crypto.SignatureEd25519) + vote.Signature = privVal.Sign(types.SignBytes(chainID, vote)) return nil } @@ -268,7 +267,7 @@ func (privVal *ByzantinePrivValidator) SignProposal(chainID string, proposal *ty defer privVal.mtx.Unlock() // Sign - proposal.Signature = privVal.Sign(types.SignBytes(chainID, proposal)).(crypto.SignatureEd25519) + proposal.Signature = privVal.Sign(types.SignBytes(chainID, proposal)) return nil } diff --git a/state/execution_test.go b/state/execution_test.go index cbaab099..16a9a080 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -134,7 +134,7 @@ func signCommit(height, round int, hash []byte, header types.PartSetHeader) *typ } sig := privKey.Sign(types.SignBytes(chainID, vote)) - vote.Signature = sig.(crypto.SignatureEd25519) + vote.Signature = sig return vote } diff --git a/types/priv_validator.go b/types/priv_validator.go index e54bc4d5..c200dff3 100644 --- a/types/priv_validator.go +++ b/types/priv_validator.go @@ -174,7 +174,7 @@ func (privVal *PrivValidator) SignVote(chainID string, vote *Vote) error { if err != nil { return errors.New(Fmt("Error signing vote: %v", err)) } - vote.Signature = signature.(crypto.SignatureEd25519) + vote.Signature = signature return nil } @@ -185,7 +185,7 @@ func (privVal *PrivValidator) SignProposal(chainID string, proposal *Proposal) e if err != nil { return errors.New(Fmt("Error signing proposal: %v", err)) } - proposal.Signature = signature.(crypto.SignatureEd25519) + proposal.Signature = signature return nil } diff --git a/types/vote.go b/types/vote.go index 2a30da0c..af4f60fc 100644 --- a/types/vote.go +++ b/types/vote.go @@ -47,13 +47,13 @@ func IsVoteTypeValid(type_ byte) bool { // Represents a prevote, precommit, or commit vote from validators for consensus. type Vote struct { - ValidatorAddress []byte `json:"validator_address"` - ValidatorIndex int `json:"validator_index"` - Height int `json:"height"` - Round int `json:"round"` - Type byte `json:"type"` - BlockID BlockID `json:"block_id"` // zero if vote is nil. - Signature crypto.SignatureEd25519 `json:"signature"` + ValidatorAddress []byte `json:"validator_address"` + ValidatorIndex int `json:"validator_index"` + Height int `json:"height"` + Round int `json:"round"` + Type byte `json:"type"` + BlockID BlockID `json:"block_id"` // zero if vote is nil. + Signature crypto.Signature `json:"signature"` } func (vote *Vote) WriteSignBytes(chainID string, w io.Writer, n *int, err *error) { diff --git a/types/vote_set_test.go b/types/vote_set_test.go index 48ccb0b1..500daadf 100644 --- a/types/vote_set_test.go +++ b/types/vote_set_test.go @@ -61,7 +61,7 @@ func withBlockPartsHeader(vote *Vote, blockPartsHeader PartSetHeader) *Vote { } func signAddVote(privVal *PrivValidator, vote *Vote, voteSet *VoteSet) (bool, error) { - vote.Signature = privVal.Sign(SignBytes(voteSet.ChainID(), vote)).(crypto.SignatureEd25519) + vote.Signature = privVal.Sign(SignBytes(voteSet.ChainID(), vote)) added, err := voteSet.AddVote(vote) return added, err }