Skip to content

Commit 84ca61b

Browse files
author
colinlyguo
committed
fix unit tests
1 parent 3bd9df7 commit 84ca61b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

rollup/internal/orm/orm_test.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ func TestBatchOrm(t *testing.T) {
318318
updatedBatch, err = batchOrm.GetLatestBatch(context.Background())
319319
assert.NoError(t, err)
320320
assert.NotNil(t, updatedBatch)
321-
assert.Equal(t, "commitTxHash", updatedBatch.CommitTxHash)
322-
assert.Equal(t, types.RollupCommitted, types.RollupStatus(updatedBatch.RollupStatus))
321+
assert.Equal(t, "", updatedBatch.CommitTxHash)
322+
assert.Equal(t, types.RollupFinalized, types.RollupStatus(updatedBatch.RollupStatus))
323323

324324
err = batchOrm.UpdateFinalizeTxHashAndRollupStatus(context.Background(), batchHash2, "finalizeTxHash", types.RollupFinalizeFailed)
325325
assert.NoError(t, err)
@@ -332,9 +332,8 @@ func TestBatchOrm(t *testing.T) {
332332

333333
batches, err := batchOrm.GetCommittedBatchesGEIndexGECodecVersion(context.Background(), 0, codecVersion, 0)
334334
assert.NoError(t, err)
335-
assert.Equal(t, 2, len(batches))
335+
assert.Equal(t, 1, len(batches))
336336
assert.Equal(t, batchHash1, batches[0].Hash)
337-
assert.Equal(t, batchHash2, batches[1].Hash)
338337

339338
batches, err = batchOrm.GetCommittedBatchesGEIndexGECodecVersion(context.Background(), 0, codecVersion, 1)
340339
assert.NoError(t, err)
@@ -343,8 +342,7 @@ func TestBatchOrm(t *testing.T) {
343342

344343
batches, err = batchOrm.GetCommittedBatchesGEIndexGECodecVersion(context.Background(), 1, codecVersion, 0)
345344
assert.NoError(t, err)
346-
assert.Equal(t, 1, len(batches))
347-
assert.Equal(t, batchHash2, batches[0].Hash)
345+
assert.Equal(t, 0, len(batches))
348346

349347
batches, err = batchOrm.GetCommittedBatchesGEIndexGECodecVersion(context.Background(), 0, codecVersion+1, 0)
350348
assert.NoError(t, err)
@@ -361,13 +359,10 @@ func TestBatchOrm(t *testing.T) {
361359

362360
batches, err = batchOrm.GetCommittedBatchesGEIndexGECodecVersion(context.Background(), 0, codecVersion, 0)
363361
assert.NoError(t, err)
364-
assert.Equal(t, 2, len(batches))
362+
assert.Equal(t, 1, len(batches))
365363
assert.Equal(t, batchHash1, batches[0].Hash)
366-
assert.Equal(t, batchHash2, batches[1].Hash)
367364
assert.Equal(t, types.ProvingTaskFailed, types.ProvingStatus(batches[0].ProvingStatus))
368365
assert.Equal(t, types.RollupCommitFailed, types.RollupStatus(batches[0].RollupStatus))
369-
assert.Equal(t, types.ProvingTaskVerified, types.ProvingStatus(batches[1].ProvingStatus))
370-
assert.Equal(t, types.RollupFinalizeFailed, types.RollupStatus(batches[1].RollupStatus))
371366
}
372367
}
373368

0 commit comments

Comments
 (0)