Skip to content

Commit

Permalink
add empty account name check to til accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Nov 15, 2024
1 parent 7f1324a commit 5706d12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions sequencer/database/historydb/historydb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
}
Expand Down
4 changes: 3 additions & 1 deletion sequencer/test/til/txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5706d12

Please sign in to comment.