From 15c19f759e6d92e8430decbde5fa8693e68c05bb Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Mon, 5 Feb 2024 02:01:21 +0800 Subject: [PATCH] tweak --- database/migrate/migrations/00003_l2_block.sql | 2 +- rollup/internal/orm/l2_block.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrate/migrations/00003_l2_block.sql b/database/migrate/migrations/00003_l2_block.sql index 00c406ffde..54704ba28a 100644 --- a/database/migrate/migrations/00003_l2_block.sql +++ b/database/migrate/migrations/00003_l2_block.sql @@ -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, diff --git a/rollup/internal/orm/l2_block.go b/rollup/internal/orm/l2_block.go index 7a68e04b3f..60d4d5a08d 100644 --- a/rollup/internal/orm/l2_block.go +++ b/rollup/internal/orm/l2_block.go @@ -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 { @@ -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 { @@ -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)