sdk update

This commit is contained in:
Roy Crihfield 2025-01-15 22:52:09 +08:00
parent 92e3a4d8f4
commit 2c083b0147
2 changed files with 13 additions and 3 deletions

View File

@ -11,9 +11,11 @@ import (
// ExportAppStateAndValidators exports the state of the application for a genesis
// file.
// This is a demonstation of how to export a genesis file. Export may need extended at
// This is a demonstration of how to export a genesis file. Export may need extended at
// the user discretion for cleaning the genesis state at the end provided with jailAllowedAddrs
// Same applies for forZeroHeight preprocessing.
func (app *LaconicApp[T]) ExportAppStateAndValidators(
forZeroHeight bool,
jailAllowedAddrs []string,
) (v2.ExportedApp, error) {
ctx := context.Background()
@ -44,5 +46,9 @@ func (app *LaconicApp[T]) ExportAppStateAndValidators(
exportedApp.AppState = genesis
exportedApp.Height = int64(latestHeight)
if forZeroHeight {
exportedApp.Height = 0
}
return exportedApp, nil
}

View File

@ -114,8 +114,12 @@ func InitRootCmd[T app.Tx](
app.Name(),
app.Store(),
app.App.AppManager,
app.AppCodec(),
&client.DefaultTxDecoder[T]{TxConfig: deps.TxConfig},
cometbft.AppCodecs[T]{
AppCodec: app.AppCodec(),
TxCodec: &client.DefaultTxDecoder[T]{TxConfig: deps.TxConfig},
LegacyAmino: deps.ClientContext.LegacyAmino,
ConsensusAddressCodec: deps.ClientContext.ConsensusAddressCodec,
},
app.App.QueryHandlers(),
app.App.SchemaDecoderResolver(),
initCometOptions[T](),