Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions core/abc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ type shardCommitter struct {
}

func (s *shardCommitter) Append(partyID arma_types.PartyID, batchSeq arma_types.BatchSequence, batchedRequests arma_types.BatchedRequests) {
nb := &naiveBatch{
requests: batchedRequests,
node: partyID,
}

nb := arma_types.NewSimpleBatch(batchSeq, arma_types.ShardID(s.shardID), partyID, batchedRequests)
s.sr.subscribers[s.shardID] <- nb
}

Expand Down
7 changes: 1 addition & 6 deletions core/assembler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,7 @@ func TestAssembler(t *testing.T) {
buff := make([]byte, 1024)
binary.BigEndian.PutUint16(buff, uint16(shardID))
binary.BigEndian.PutUint16(buff[100:], uint16(seq))
batch := &naiveBatch{
shardID: shardID,
node: 1,
seq: seq,
requests: [][]byte{buff},
}
batch := types.NewSimpleBatch(seq, shardID, 1, [][]byte{buff})
digests[string(batch.Digest())] = struct{}{}
batchesForShard = append(batchesForShard, batch)
}
Expand Down
34 changes: 1 addition & 33 deletions core/batcher_old_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ func (r *naiveReplication) Stop() {

func (r *naiveReplication) Append(partyID arma_types.PartyID, batchSeq arma_types.BatchSequence, batchedRequests arma_types.BatchedRequests) {
for _, s := range r.subscribers {
s <- &naiveBatch{
node: partyID,
seq: arma_types.BatchSequence(batchSeq),
requests: batchedRequests,
}
s <- arma_types.NewSimpleBatch(batchSeq, 0, partyID, batchedRequests)
}
}

Expand All @@ -84,34 +80,6 @@ func (r *naiveReplication) RetrieveBatchByNumber(partyID arma_types.PartyID, seq
return nil
}

type naiveBatch struct {
shardID arma_types.ShardID
node arma_types.PartyID
seq arma_types.BatchSequence
requests [][]byte
}

func (nb *naiveBatch) Primary() arma_types.PartyID {
return nb.node
}

func (nb *naiveBatch) Digest() []byte {
br := arma_types.BatchedRequests(nb.requests)
return br.Digest()
}

func (nb *naiveBatch) Shard() arma_types.ShardID {
return nb.shardID
}

func (nb *naiveBatch) Seq() arma_types.BatchSequence {
return nb.seq
}

func (nb *naiveBatch) Requests() arma_types.BatchedRequests {
return nb.requests
}

type acker struct {
from arma_types.PartyID
batchers []*core.Batcher
Expand Down