(index, startTs, commitTs uint64)
| 28 | } |
| 29 | |
| 30 | func getEntryForCommit(index, startTs, commitTs uint64) raftpb.Entry { |
| 31 | delta := &pb.OracleDelta{} |
| 32 | delta.Txns = append(delta.Txns, &pb.TxnStatus{StartTs: startTs, CommitTs: commitTs}) |
| 33 | proposal := &pb.Proposal{Delta: delta} |
| 34 | sz := proto.Size(proposal) |
| 35 | data := make([]byte, 8+sz) |
| 36 | x.Check2(x.MarshalToSizedBuffer(data[8:], proposal)) |
| 37 | data = data[:8+sz] |
| 38 | return raftpb.Entry{Index: index, Term: 1, Type: raftpb.EntryNormal, Data: data} |
| 39 | } |
| 40 | |
| 41 | func TestCalculateSnapshot(t *testing.T) { |
| 42 | dir := t.TempDir() |
no test coverage detected