cosmos-sdk/cmd/gaia/init/utils_test.go
Alessio Treglia fbc6bdae18
gaiad: ExportGenesisFile() incorrectly overwrites genesis (#4063)
ExportGenesisFile() overwrites all non-gaia related
sections of the genesis.json file as it always
creates a new one from scratch.

Remove cmd/gaia/init.LoadGenesisDoc() in favor of
tendermint's types.GenesisDocFromFile().

Closes: #4066
2019-04-08 18:54:45 +01:00

22 lines
429 B
Go

package init
import (
"encoding/json"
"path/filepath"
"testing"
"time"
"github.com/cosmos/cosmos-sdk/tests"
"github.com/stretchr/testify/require"
)
func TestExportGenesisFileWithTime(t *testing.T) {
t.Parallel()
dir, cleanup := tests.NewTestCaseDir(t)
defer cleanup()
fname := filepath.Join(dir, "genesis.json")
require.NoError(t, ExportGenesisFileWithTime(fname, "test", nil, json.RawMessage(""), time.Now()))
}