Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Feb 4, 2024
1 parent 341d5be commit 15c19f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion database/migrate/migrations/00003_l2_block.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ create table l2_block
hash VARCHAR NOT NULL,
parent_hash VARCHAR NOT NULL,
header TEXT NOT NULL,
transactions TEXT NOT NULL,
transactions TEXT NOT NULL, -- deprecated.
withdraw_root VARCHAR NOT NULL,
state_root VARCHAR NOT NULL,
tx_num INTEGER NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions rollup/internal/orm/l2_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (o *L2Block) GetL2WrappedBlocksGEHeight(ctx context.Context, height uint64,
var transactions []*gethTypes.Transaction
var err error

// Empty transactions in legacy JSON string is "[]", thus can use "" to check is the field is deprecated in this row.
// Empty transactions in legacy JSON string is "[]", thus can use "" to check whether the field is deprecated in this row.
if v.Transactions != "" {
transactions, err = decodeTransactionDataJSON([]byte(v.Transactions))
if err != nil {
Expand Down Expand Up @@ -180,7 +180,7 @@ func (o *L2Block) GetL2BlocksInRange(ctx context.Context, startBlockNumber uint6
var transactions []*gethTypes.Transaction
var err error

// Empty transactions in legacy JSON string is "[]", thus can use "" to check is the field is deprecated in this row.
// Empty transactions in legacy JSON string is "[]", thus can use "" to check whether the field is deprecated in this row.
if v.Transactions != "" {
transactions, err = decodeTransactionDataJSON([]byte(v.Transactions))
if err != nil {
Expand Down Expand Up @@ -224,7 +224,7 @@ func (o *L2Block) InsertL2Blocks(ctx context.Context, blocks []*rollupTypes.Wrap
transactionsRLP, err := rlp.EncodeToBytes(block.Transactions)
if err != nil {
log.Error("failed to encode transactions to rlp encoding", "hash", block.Header.Hash().String(), "err", err)
return fmt.Errorf("L2Block.InsertL2Blocks, failed to encode transactions to rlp encoding, error: %w", err)
return fmt.Errorf("L2Block.InsertL2Blocks error: %w", err)
}

rc, err := json.Marshal(block.RowConsumption)
Expand Down

0 comments on commit 15c19f7

Please sign in to comment.