raft: remove unused raftpb.LastIndex

This commit is contained in:
Yicheng Qin
2014-09-15 14:34:23 -07:00
parent 07648f1f25
commit cc8d8f2102
5 changed files with 12 additions and 31 deletions

View File

@@ -140,12 +140,12 @@ func TestNode(t *testing.T) {
wants := []Ready{
{
State: raftpb.State{Term: 1, Commit: 1, LastIndex: 1},
State: raftpb.State{Term: 1, Commit: 1},
Entries: []raftpb.Entry{{}, {Term: 1, Index: 1}},
CommittedEntries: []raftpb.Entry{{Term: 1, Index: 1}},
},
{
State: raftpb.State{Term: 1, Commit: 2, LastIndex: 2},
State: raftpb.State{Term: 1, Commit: 2},
Entries: []raftpb.Entry{{Term: 1, Index: 2, Data: []byte("foo")}},
CommittedEntries: []raftpb.Entry{{Term: 1, Index: 2, Data: []byte("foo")}},
},
@@ -175,7 +175,7 @@ func TestNodeRestart(t *testing.T) {
{Term: 1, Index: 1},
{Term: 1, Index: 2, Data: []byte("foo")},
}
st := raftpb.State{Term: 1, Commit: 1, LastIndex: 2}
st := raftpb.State{Term: 1, Commit: 1}
want := Ready{
State: emptyState,
@@ -204,7 +204,6 @@ func TestIsStateEqual(t *testing.T) {
{raftpb.State{Vote: 1}, false},
{raftpb.State{Commit: 1}, false},
{raftpb.State{Term: 1}, false},
{raftpb.State{LastIndex: 1}, false},
}
for i, tt := range tests {