Skip to content

Commit b352e3f

Browse files
authored
Export methods for in-place-testnet command (#255)
1 parent 184afc7 commit b352e3f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

export/export.go

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package export
2+
3+
import (
4+
"github.com/tendermint/tendermint/internal/state"
5+
"github.com/tendermint/tendermint/internal/store"
6+
)
7+
8+
var NewBlockStore = store.NewBlockStore
9+
var NewStore = state.NewStore

node/node.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func makeNode(
168168
return nil, combineCloseError(fmt.Errorf("error in genesis doc: %w", err), makeCloser(closers))
169169
}
170170

171-
state, err := loadStateFromDBOrGenesisDocProvider(stateStore, genDoc)
171+
state, err := LoadStateFromDBOrGenesisDocProvider(stateStore, genDoc)
172172
if err != nil {
173173
return nil, combineCloseError(err, makeCloser(closers))
174174
}
@@ -778,10 +778,10 @@ func DefaultMetricsProvider(cfg *config.InstrumentationConfig) metricsProvider {
778778

779779
//------------------------------------------------------------------------------
780780

781-
// loadStateFromDBOrGenesisDocProvider attempts to load the state from the
781+
// LoadStateFromDBOrGenesisDocProvider attempts to load the state from the
782782
// database, or creates one using the given genesisDocProvider. On success this also
783783
// returns the genesis doc loaded through the given provider.
784-
func loadStateFromDBOrGenesisDocProvider(stateStore sm.Store, genDoc *types.GenesisDoc) (sm.State, error) {
784+
func LoadStateFromDBOrGenesisDocProvider(stateStore sm.Store, genDoc *types.GenesisDoc) (sm.State, error) {
785785

786786
// 1. Attempt to load state form the database
787787
state, err := stateStore.Load()

node/node_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ func loadStatefromGenesis(ctx context.Context, t *testing.T) sm.State {
777777
valSet, _ := factory.ValidatorSet(ctx, t, 0, 10)
778778
genDoc := factory.GenesisDoc(cfg, time.Now(), valSet.Validators, factory.ConsensusParams())
779779

780-
state, err := loadStateFromDBOrGenesisDocProvider(
780+
state, err := LoadStateFromDBOrGenesisDocProvider(
781781
stateStore,
782782
genDoc,
783783
)

0 commit comments

Comments
 (0)