github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/core/ledger/kvledger/test_exports.go (about) 1 /* 2 Copyright hechain. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package kvledger 8 9 import ( 10 "testing" 11 12 "github.com/hechain20/hechain/common/ledger/util/leveldbhelper" 13 "github.com/stretchr/testify/require" 14 ) 15 16 // UpgradeIDStoreFormat updates ledger idStore to current format 17 func UpgradeIDStoreFormat(t *testing.T, rootFSPath string) { 18 dbPath := LedgerProviderPath(rootFSPath) 19 db := leveldbhelper.CreateDB(&leveldbhelper.Conf{DBPath: dbPath}) 20 db.Open() 21 defer db.Close() 22 23 idStore := &idStore{db, dbPath} 24 require.NoError(t, idStore.upgradeFormat()) 25 }