Skip to content

Commit

Permalink
fix unmarshall
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Apr 29, 2024
1 parent 41237e5 commit 159758d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (a *Aggregator) handleReceivedDataStream(entry *datastreamer.FileEntry, cli
switch entry.Type {
case datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_BATCH):
batch := &datastream.Batch{}
err := json.Unmarshal(entry.Data, batch)
err := proto.Unmarshal(entry.Data, batch)
if err != nil {
log.Errorf("Error unmarshalling batch: %v", err)
return err
Expand Down Expand Up @@ -236,7 +236,7 @@ func (a *Aggregator) handleReceivedDataStream(entry *datastreamer.FileEntry, cli
a.currentStreamBatchRaw.Blocks = append(a.currentStreamBatchRaw.Blocks, a.currentStreamL2Block)
// "Open" the new block
l2Block := &datastream.L2Block{}
err := json.Unmarshal(entry.Data, l2Block)
err := proto.Unmarshal(entry.Data, l2Block)
if err != nil {
log.Errorf("Error unmarshalling L2Block: %v", err)
return err
Expand All @@ -256,7 +256,7 @@ func (a *Aggregator) handleReceivedDataStream(entry *datastreamer.FileEntry, cli

case datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_TRANSACTION):
l2Tx := &datastream.Transaction{}
err := json.Unmarshal(entry.Data, l2Tx)
err := proto.Unmarshal(entry.Data, l2Tx)
if err != nil {
log.Errorf("Error unmarshalling L2Tx: %v", err)
return err
Expand Down

0 comments on commit 159758d

Please sign in to comment.