From 5706d12fd3ee3d209515d7b6b00e64820f5bdc3c Mon Sep 17 00:00:00 2001 From: Intizar Date: Sat, 16 Nov 2024 00:25:51 +0900 Subject: [PATCH] add empty account name check to til accounts --- sequencer/database/historydb/historydb_test.go | 2 -- sequencer/test/til/txs.go | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sequencer/database/historydb/historydb_test.go b/sequencer/database/historydb/historydb_test.go index e02993d..33a34cf 100644 --- a/sequencer/database/historydb/historydb_test.go +++ b/sequencer/database/historydb/historydb_test.go @@ -964,7 +964,6 @@ func TestTxItemID(t *testing.T) { var chainID uint16 = 0 tc := til.NewContext(chainID, common.RollupConstMaxL1UserTx) blocks, err := tc.GenerateBlocksFromInstructions(set) - fmt.Println("Block len ", len(blocks)) assert.NoError(t, err) tilCfgExtra := til.ConfigExtra{ @@ -975,7 +974,6 @@ func TestTxItemID(t *testing.T) { // Add all blocks for i := range blocks { - fmt.Println("Adding block", i) err = historyDB.AddBlockSCData(&blocks[i]) require.NoError(t, err) } diff --git a/sequencer/test/til/txs.go b/sequencer/test/til/txs.go index 7908ba5..3aecbee 100644 --- a/sequencer/test/til/txs.go +++ b/sequencer/test/til/txs.go @@ -166,7 +166,9 @@ func (tc *Context) GenerateBlocksFromInstructions(set []Instruction) ([]common.B accountNames := []string{} addedNames := make(map[string]bool) for _, inst := range set { - if _, ok := addedNames[inst.From]; !ok { + // TODO: hermez doesn't have `inst.From != ""` condition but without it + // empty string gets added to the accountNames + if _, ok := addedNames[inst.From]; !ok && inst.From != "" { // If the name wasn't already added accountNames = append(accountNames, inst.From) addedNames[inst.From] = true