Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Jul 5, 2024
1 parent 36a882f commit 68ebafa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go/enclave/components/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestInvalidBlocksAreRejected(t *testing.T) {

for _, header := range invalidHeaders {
loopHeader := header
_, err := blockConsumer.ingestBlock(context.Background(), types.NewBlock(&loopHeader, nil, nil, nil, &trie.StackTrie{}))
_, err := blockConsumer.ingestBlock(context.Background(), types.NewBlock(&loopHeader, nil, nil, &trie.StackTrie{}))
if err == nil {
t.Errorf("expected block with invalid header to be rejected but was accepted")
}
Expand Down
14 changes: 7 additions & 7 deletions go/host/storage/hostdb/rollup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestCanStoreAndRetrieveRollup(t *testing.T) {

metadata := createRollupMetadata(batchNumber - 10)
rollup := createRollup(batchNumber)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down Expand Up @@ -60,7 +60,7 @@ func TestGetRollupByBlockHash(t *testing.T) {

metadata := createRollupMetadata(batchNumber - 10)
rollup := createRollup(batchNumber)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestGetLatestRollup(t *testing.T) {
rollup1LastSeq := int64(batchNumber)
metadata1 := createRollupMetadata(rollup1FirstSeq)
rollup1 := createRollup(rollup1LastSeq)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down Expand Up @@ -137,7 +137,7 @@ func TestGetRollupBySeqNo(t *testing.T) {
rollup1LastSeq := int64(batchNumber)
metadata1 := createRollupMetadata(rollup1FirstSeq)
rollup1 := createRollup(rollup1LastSeq)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestGetRollupListing(t *testing.T) {
rollup1LastSeq := int64(batchNumber)
metadata1 := createRollupMetadata(rollup1FirstSeq)
rollup1 := createRollup(rollup1LastSeq)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestGetRollupByHash(t *testing.T) {
rollup1LastSeq := int64(batchNumber)
metadata1 := createRollupMetadata(rollup1FirstSeq)
rollup1 := createRollup(rollup1LastSeq)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err = AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down Expand Up @@ -336,7 +336,7 @@ func TestGetRollupBatches(t *testing.T) {
db, _ := createSQLiteDB(t)
txHashesOne := []common.L2TxHash{gethcommon.BytesToHash([]byte("magicStringOne")), gethcommon.BytesToHash([]byte("magicStringTwo"))}
batchOne := createBatch(batchNumber, txHashesOne)
block := types.NewBlock(&types.Header{}, nil, nil, nil, nil)
block := types.NewBlock(&types.Header{}, nil, nil, nil)
dbtx, _ := db.NewDBTransaction()
err := AddBlock(dbtx, db.GetSQLStatement(), block.Header())
if err != nil {
Expand Down

0 comments on commit 68ebafa

Please sign in to comment.