diff --git a/consensus/state.go b/consensus/state.go index 8eda7cb4..a590b921 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -408,17 +408,12 @@ func (cs *ConsensusState) stageBlock(block *Block) error { return nil } - // Basic validation is done in state.CommitBlock(). - //err := block.ValidateBasic() - //if err != nil { - // return err - //} - // Create a copy of the state for staging - stateCopy := cs.state.Copy() // Deep copy the state before staging. + stateCopy := cs.state.Copy() // Commit block onto the copied state. - err := stateCopy.AppendBlock(block) + // NOTE: Basic validation is done in state.AppendBlock(). + err := stateCopy.AppendBlock(block, true) if err != nil { return err } else { diff --git a/consensus/vote_set_test.go b/consensus/vote_set_test.go new file mode 100644 index 00000000..3d378138 --- /dev/null +++ b/consensus/vote_set_test.go @@ -0,0 +1,24 @@ +package consensus + +import ( + . "github.com/tendermint/tendermint/state" + + "testing" +) + +func makeValidator(id uint64, votingPower uint64) (*Validator, *PrivAccount) { + privAccount := GenPrivAccount() + privAccount.Id = id + return &Validator{ + Account: privAccount.Account, + VotingPower: votingPower, + }, privAccount +} + +func TestAddVote(t *testing.T) { + // XXX +} + +func Test2_3Majority(t *testing.T) { + // XXX +}