Rework of bootstrap finalization process.

This commit is contained in:
CalDescent
2021-10-08 18:06:41 +01:00
parent 47ce884bbe
commit a1e4047695
2 changed files with 19 additions and 8 deletions

View File

@@ -68,7 +68,6 @@ public class BootstrapTests extends Common {
@Test
public void testCreateAndImportBootstrap() throws DataException, InterruptedException, TransformationException, IOException {
Path bootstrapPath = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap-archive.7z"));
Path archivePath = Paths.get(Settings.getInstance().getRepositoryPath(), "archive", "2-900.dat");
BlockData block1000;
byte[] originalArchiveContents;
@@ -76,10 +75,13 @@ public class BootstrapTests extends Common {
try (final Repository repository = RepositoryManager.getRepository()) {
this.buildDummyBlockchain(repository);
Bootstrap bootstrap = new Bootstrap(repository);
Path bootstrapPath = bootstrap.getBootstrapOutputPath();
// Ensure the compressed bootstrap doesn't exist
assertFalse(Files.exists(bootstrapPath));
Bootstrap bootstrap = new Bootstrap(repository);
// Create bootstrap
bootstrap.create();
// Ensure the compressed bootstrap exists