-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into dev/speedup_iavl_iterator
- Loading branch information
Showing
16 changed files
with
134 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package server | ||
|
||
import ( | ||
"testing" | ||
"github.com/stretchr/testify/require" | ||
"github.com/cosmos/cosmos-sdk/wire" | ||
"github.com/tendermint/tendermint/libs/log" | ||
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" | ||
"os" | ||
"bytes" | ||
"io" | ||
"github.com/cosmos/cosmos-sdk/server/mock" | ||
) | ||
|
||
func TestEmptyState(t *testing.T) { | ||
defer setupViper(t)() | ||
logger := log.NewNopLogger() | ||
cfg, err := tcmd.ParseConfig() | ||
require.Nil(t, err) | ||
ctx := NewContext(cfg, logger) | ||
cdc := wire.NewCodec() | ||
appInit := AppInit{ | ||
AppGenTx: mock.AppGenTx, | ||
AppGenState: mock.AppGenStateEmpty, | ||
} | ||
cmd := InitCmd(ctx, cdc, appInit) | ||
err = cmd.RunE(nil, nil) | ||
require.NoError(t, err) | ||
|
||
old := os.Stdout | ||
r, w, _ := os.Pipe() | ||
os.Stdout = w | ||
cmd = ExportCmd(ctx, cdc, nil) | ||
err = cmd.RunE(nil, nil) | ||
require.NoError(t, err) | ||
|
||
outC := make(chan string) | ||
go func() { | ||
var buf bytes.Buffer | ||
io.Copy(&buf, r) | ||
outC <- buf.String() | ||
}() | ||
|
||
w.Close() | ||
os.Stdout = old | ||
out := <-outC | ||
require.Contains(t, out, "WARNING: State is not initialized") | ||
require.Contains(t, out, "genesis_time") | ||
require.Contains(t, out, "chain_id") | ||
require.Contains(t, out, "consensus_params") | ||
require.Contains(t, out, "validators") | ||
require.Contains(t, out, "app_hash") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters