diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a71cb3c360f..151e10d38d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Bug Fixes + +* (export) [#13029](https://github.com/cosmos/cosmos-sdk/pull/13029) Fix exporting the blockParams regression. + ## [v0.46.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.1) - 2022-08-24 ### Improvements diff --git a/server/export.go b/server/export.go index a832c1340a9c..1ae4f1c723d5 100644 --- a/server/export.go +++ b/server/export.go @@ -82,8 +82,9 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com doc.InitialHeight = exported.Height doc.ConsensusParams = &tmproto.ConsensusParams{ Block: tmproto.BlockParams{ - MaxBytes: exported.ConsensusParams.Block.MaxBytes, - MaxGas: exported.ConsensusParams.Block.MaxGas, + MaxBytes: exported.ConsensusParams.Block.MaxBytes, + MaxGas: exported.ConsensusParams.Block.MaxGas, + TimeIotaMs: doc.ConsensusParams.Block.TimeIotaMs, }, Evidence: tmproto.EvidenceParams{ MaxAgeNumBlocks: exported.ConsensusParams.Evidence.MaxAgeNumBlocks, @@ -104,6 +105,7 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com } cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.OutOrStderr()) cmd.Println(string(sdk.MustSortJSON(encoded))) return nil }, diff --git a/server/export_test.go b/server/export_test.go index b9def353d1d7..0bf955a2573a 100644 --- a/server/export_test.go +++ b/server/export_test.go @@ -31,7 +31,7 @@ import ( func TestExportCmd_ConsensusParams(t *testing.T) { tempDir := t.TempDir() - _, ctx, _, cmd := setupApp(t, tempDir) + _, ctx, genDoc, cmd := setupApp(t, tempDir) output := &bytes.Buffer{} cmd.SetOut(output) @@ -46,6 +46,7 @@ func TestExportCmd_ConsensusParams(t *testing.T) { require.Equal(t, simapp.DefaultConsensusParams.Block.MaxBytes, exportedGenDoc.ConsensusParams.Block.MaxBytes) require.Equal(t, simapp.DefaultConsensusParams.Block.MaxGas, exportedGenDoc.ConsensusParams.Block.MaxGas) + require.Equal(t, genDoc.ConsensusParams.Block.TimeIotaMs, exportedGenDoc.ConsensusParams.Block.TimeIotaMs) require.Equal(t, simapp.DefaultConsensusParams.Evidence.MaxAgeDuration, exportedGenDoc.ConsensusParams.Evidence.MaxAgeDuration) require.Equal(t, simapp.DefaultConsensusParams.Evidence.MaxAgeNumBlocks, exportedGenDoc.ConsensusParams.Evidence.MaxAgeNumBlocks)