Skip to content

Commit

Permalink
fixes after review.
Browse files Browse the repository at this point in the history
  • Loading branch information
cristure committed Apr 23, 2024
1 parent 143e3c0 commit 36bdd0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions process/dataAggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func (da *dataAggregator) ProcessHyperBlock(outportBlock *outport.OutportBlock)
hyperOutportBlock := &data.HyperOutportBlock{}
hyperOutportBlock.MetaOutportBlock = outportBlock

n := len(outportBlock.NotarizedHeadersHashes)
notarizedShardOutportBlocks := make([]*data.NotarizedHeaderOutportData, 0, n)
notarizedShardOutportBlocks := make([]*data.NotarizedHeaderOutportData, 0, len(outportBlock.NotarizedHeadersHashes))

log.Info("dataAggregator: notarizedHashes", "block hash", outportBlock.BlockData.HeaderHash,
"num notarizedHashes", len(outportBlock.NotarizedHeadersHashes))
Expand Down
6 changes: 2 additions & 4 deletions process/outportBlockConverter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ func (o *outportBlockConverter) HandleShardOutportBlock(outportBlock *outport.Ou
return nil, fmt.Errorf("failed to unmarshal: %w", err)
}

n := len(header.Header.MiniBlockHeaders)
miniBlockHeaders := make([]*data.MiniBlockHeader, 0, n)
miniBlockHeaders := make([]*data.MiniBlockHeader, 0, len(header.Header.MiniBlockHeaders))
for _, miniBlockHeader := range header.Header.MiniBlockHeaders {
mb := &data.MiniBlockHeader{
Hash: miniBlockHeader.Hash,
Expand All @@ -77,8 +76,7 @@ func (o *outportBlockConverter) HandleShardOutportBlock(outportBlock *outport.Ou
miniBlockHeaders = append(miniBlockHeaders, mb)
}

n = len(header.Header.PeerChanges)
peerChanges := make([]*data.PeerChange, 0, n)
peerChanges := make([]*data.PeerChange, 0, len(header.Header.PeerChanges))
for _, peerChange := range header.Header.PeerChanges {
pc := &data.PeerChange{
PubKey: peerChange.PubKey,
Expand Down

0 comments on commit 36bdd0d

Please sign in to comment.