Skip to content

Commit

Permalink
server: export app version
Browse files Browse the repository at this point in the history
  • Loading branch information
najeal committed Jul 5, 2024
1 parent 83c372b commit a662b80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com
Validator: tmproto.ValidatorParams{
PubKeyTypes: exported.ConsensusParams.Validator.PubKeyTypes,
},
Version: tmproto.VersionParams{
AppVersion: exported.ConsensusParams.GetVersion().GetAppVersion(),
},
}

// NOTE: Tendermint uses a custom JSON decoder for GenesisDoc
Expand Down
2 changes: 2 additions & 0 deletions server/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func TestExportCmd_ConsensusParams(t *testing.T) {
require.Equal(t, simapp.DefaultConsensusParams.Evidence.MaxAgeNumBlocks, exportedGenDoc.ConsensusParams.Evidence.MaxAgeNumBlocks)

require.Equal(t, simapp.DefaultConsensusParams.Validator.PubKeyTypes, exportedGenDoc.ConsensusParams.Validator.PubKeyTypes)
require.Equal(t, simapp.DefaultConsensusParams.Version.AppVersion, exportedGenDoc.ConsensusParams.Version.AppVersion)
}

func TestExportCmd_HomeDir(t *testing.T) {
Expand Down Expand Up @@ -152,6 +153,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t
AppStateBytes: genDoc.AppState,
},
)
app.SetInitialAppVersionInConsensusParams(app.NewContext(false, tmproto.Header{}), simapp.DefaultConsensusParams.Version.AppVersion)
app.Commit()

cmd := server.ExportCmd(
Expand Down
3 changes: 3 additions & 0 deletions simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ var DefaultConsensusParams = &abci.ConsensusParams{
tmtypes.ABCIPubKeyTypeEd25519,
},
},
Version: &tmproto.VersionParams{
AppVersion: 1,
},
}

// SetupOptions defines arguments that are passed into `Simapp` constructor.
Expand Down

0 comments on commit a662b80

Please sign in to comment.