Skip to content

Commit

Permalink
fix: fix snapshot ut
Browse files Browse the repository at this point in the history
  • Loading branch information
will@2012 committed Mar 12, 2024
1 parent 1735ea9 commit 1746064
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/blockchain_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,13 @@ func TestNoCommitCrashWithNewSnapshot(t *testing.T) {
// Expected head block : G
// Expected snapshot disk : C4
for _, scheme := range []string{rawdb.HashScheme, rawdb.PathScheme} {
// in hash scheme ,rewind use snapshot root and the snapshot root block number = 4.
// Last committed disk layer, wait recovery
snapshotBottom := uint64(4)
if scheme == rawdb.PathScheme {
// in path scheme, rewind use trie head as disk root and trie head block number = 0.
snapshotBottom = 0
}
test := &crashSnapshotTest{
snapshotTestBasic{
scheme: scheme,
Expand All @@ -493,7 +500,7 @@ func TestNoCommitCrashWithNewSnapshot(t *testing.T) {
expHeadHeader: 8,
expHeadFastBlock: 8,
expHeadBlock: 0,
expSnapshotBottom: 4, // Last committed disk layer, wait recovery
expSnapshotBottom: snapshotBottom,
},
}
test.test(t)
Expand Down

0 comments on commit 1746064

Please sign in to comment.