tendermint/account -> acm

This commit is contained in:
Jae Kwon
2015-07-19 09:40:55 -07:00
parent 8d1e176180
commit 1e7cc32597
25 changed files with 213 additions and 214 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ import (
"sync/atomic"
"time"
"github.com/tendermint/tendermint/account"
acm "github.com/tendermint/tendermint/account"
"github.com/tendermint/tendermint/binary"
bc "github.com/tendermint/tendermint/blockchain"
. "github.com/tendermint/tendermint/common"
@@ -1011,7 +1011,7 @@ func (cs *ConsensusState) SetProposal(proposal *Proposal) error {
}
// Verify signature
if !cs.Validators.Proposer().PubKey.VerifyBytes(account.SignBytes(cs.state.ChainID, proposal), proposal.Signature) {
if !cs.Validators.Proposer().PubKey.VerifyBytes(acm.SignBytes(cs.state.ChainID, proposal), proposal.Signature) {
return ErrInvalidProposalSignature
}
+6 -6
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"io"
"github.com/tendermint/tendermint/account"
acm "github.com/tendermint/tendermint/account"
"github.com/tendermint/tendermint/binary"
. "github.com/tendermint/tendermint/common"
"github.com/tendermint/tendermint/types"
@@ -17,11 +17,11 @@ var (
)
type Proposal struct {
Height int `json:"height"`
Round int `json:"round"`
BlockPartsHeader types.PartSetHeader `json:"block_parts_header"`
POLRound int `json:"pol_round"` // -1 if null.
Signature account.SignatureEd25519 `json:"signature"`
Height int `json:"height"`
Round int `json:"round"`
BlockPartsHeader types.PartSetHeader `json:"block_parts_header"`
POLRound int `json:"pol_round"` // -1 if null.
Signature acm.SignatureEd25519 `json:"signature"`
}
func NewProposal(height int, round int, blockPartsHeader types.PartSetHeader, polRound int) *Proposal {
+2 -2
View File
@@ -3,7 +3,7 @@ package consensus
import (
"testing"
"github.com/tendermint/tendermint/account"
acm "github.com/tendermint/tendermint/account"
. "github.com/tendermint/tendermint/common"
_ "github.com/tendermint/tendermint/config/tendermint_test"
"github.com/tendermint/tendermint/types"
@@ -16,7 +16,7 @@ func TestProposalSignable(t *testing.T) {
BlockPartsHeader: types.PartSetHeader{111, []byte("blockparts")},
POLRound: -1,
}
signBytes := account.SignBytes(config.GetString("chain_id"), proposal)
signBytes := acm.SignBytes(config.GetString("chain_id"), proposal)
signStr := string(signBytes)
expected := Fmt(`{"chain_id":"%s","proposal":{"block_parts_header":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_round":-1,"round":23456}}`,
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"strings"
"sync"
"github.com/tendermint/tendermint/account"
acm "github.com/tendermint/tendermint/account"
"github.com/tendermint/tendermint/binary"
. "github.com/tendermint/tendermint/common"
sm "github.com/tendermint/tendermint/state"
@@ -131,7 +131,7 @@ func (voteSet *VoteSet) addVote(val *sm.Validator, valIndex int, vote *types.Vot
}
// Check signature.
if !val.PubKey.VerifyBytes(account.SignBytes(config.GetString("chain_id"), vote), vote.Signature) {
if !val.PubKey.VerifyBytes(acm.SignBytes(config.GetString("chain_id"), vote), vote.Signature) {
// Bad signature.
return false, 0, types.ErrVoteInvalidSignature
}