Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Sep 10, 2024
1 parent 7c6595c commit 1f53982
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions sequencesender/ethtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (s *SequenceSender) syncAllEthTxResults(ctx context.Context) error {
for _, result := range results {
txSequence, exists := s.ethTransactions[result.ID]
if !exists {
log.Infof("transaction %v missing in memory structure. Adding it", result.ID)
log.Debugf("transaction %v missing in memory structure. Adding it", result.ID)
// No info: from/to batch and the sent timestamp
s.ethTransactions[result.ID] = &ethTxData{
SentL1Timestamp: time.Time{},
Expand Down Expand Up @@ -352,7 +352,7 @@ func (s *SequenceSender) saveSentSequencesTransactions(ctx context.Context) erro
// Purge tx
s.purgeEthTx(ctx)

// Ceate file
// Create file
fileName := s.cfg.SequencesTxFileName[0:strings.IndexRune(s.cfg.SequencesTxFileName, '.')] + ".tmp"
s.sequencesTxFile, err = os.Create(fileName)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions sequencesender/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ func (s *SequenceSender) getL2BlockTimestampFromRPC(blockHash string) (uint64, e
Timestamp string `json:"timestamp"`
}

l2Block := zkeEVML2Block{}

log.Infof("Getting l2 block timestamp from RPC. Block hash: %s", blockHash)

response, err := rpc.JSONRPCCall(s.cfg.RPCURL, "eth_getBlockByHash", blockHash, false)
Expand All @@ -85,7 +83,8 @@ func (s *SequenceSender) getL2BlockTimestampFromRPC(blockHash string) (uint64, e
return 0, fmt.Errorf("error in the response calling eth_getBlockByHash: %v", response.Error)
}

// Get the batch number from the response hex string
// Get the l2 block from the response
l2Block := zkeEVML2Block{}
err = json.Unmarshal(response.Result, &l2Block)
if err != nil {
return 0, fmt.Errorf("error unmarshalling the l2 block from the response calling eth_getBlockByHash: %v", err)
Expand Down
5 changes: 3 additions & 2 deletions sequencesender/sequencesender.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,10 @@ func (s *SequenceSender) getLatestVirtualBatch() error {
if err != nil {
log.Errorf("error getting latest virtual batch, error: %v", err)
return errors.New("fail to get latest virtual batch")
} else {
log.Infof("latest virtual batch is %d", s.latestVirtualBatchNumber)
}

log.Infof("latest virtual batch is %d", s.latestVirtualBatchNumber)

return nil
}

Expand Down

0 comments on commit 1f53982

Please sign in to comment.