Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Jun 26, 2024
1 parent 2921e72 commit 233071f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions go/host/storage/hostdb/rollup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"testing"
"time"

"github.com/ethereum/go-ethereum/core/types"

gethcommon "github.com/ethereum/go-ethereum/common"

"github.com/ten-protocol/go-ten/go/common"
Expand All @@ -18,9 +20,15 @@ func TestCanStoreAndRetrieveRollup(t *testing.T) {

metadata := createRollupMetadata(batchNumber - 10)
rollup := createRollup(batchNumber)
block := common.L1Block{}
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, &block)
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
t.Errorf("could not store block. Cause: %s", err)
}
dbtx.Write()
dbtx, _ = db.NewDBTransaction()
err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block)
if err != nil {
t.Errorf("could not store rollup. Cause: %s", err)
}
Expand Down

0 comments on commit 233071f

Please sign in to comment.