From 84bdd0180ec5ff291f5cc6be8a3c9eefb89c56a0 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Fri, 13 Oct 2023 15:43:28 +0900 Subject: [PATCH] ffldb: change export_test.go to export.go The testing function in export_test.go is changed to just export.go so that callers outside the ffldb package will be able to call the function. The main use for this is so that the prune code can be triggered from the blockchain package. This allows testing code to have less than 1.5GB worth of blocks to trigger the prune. --- database/ffldb/{export_test.go => export.go} | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) rename database/ffldb/{export_test.go => export.go} (68%) diff --git a/database/ffldb/export_test.go b/database/ffldb/export.go similarity index 68% rename from database/ffldb/export_test.go rename to database/ffldb/export.go index cbb6dc94..0802167e 100644 --- a/database/ffldb/export_test.go +++ b/database/ffldb/export.go @@ -2,13 +2,6 @@ // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. -/* -This test file is part of the ffldb package rather than than the ffldb_test -package so it can bridge access to the internals to properly test cases which -are either not possible or can't reliably be tested via the public interface. -The functions are only exported while the tests are being run. -*/ - package ffldb import ( @@ -18,6 +11,8 @@ import ( // TstRunWithMaxBlockFileSize runs the passed function with the maximum allowed // file size for the database set to the provided value. The value will be set // back to the original value upon completion. +// +// Callers should only use this for testing. func TstRunWithMaxBlockFileSize(idb database.DB, size uint32, fn func()) { ffldb := idb.(*db) origSize := ffldb.store.maxBlockFileSize