sdk update
This commit is contained in:
parent
92e3a4d8f4
commit
2c083b0147
@ -11,9 +11,11 @@ import (
|
|||||||
|
|
||||||
// ExportAppStateAndValidators exports the state of the application for a genesis
|
// ExportAppStateAndValidators exports the state of the application for a genesis
|
||||||
// file.
|
// 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
|
// the user discretion for cleaning the genesis state at the end provided with jailAllowedAddrs
|
||||||
|
// Same applies for forZeroHeight preprocessing.
|
||||||
func (app *LaconicApp[T]) ExportAppStateAndValidators(
|
func (app *LaconicApp[T]) ExportAppStateAndValidators(
|
||||||
|
forZeroHeight bool,
|
||||||
jailAllowedAddrs []string,
|
jailAllowedAddrs []string,
|
||||||
) (v2.ExportedApp, error) {
|
) (v2.ExportedApp, error) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
@ -44,5 +46,9 @@ func (app *LaconicApp[T]) ExportAppStateAndValidators(
|
|||||||
|
|
||||||
exportedApp.AppState = genesis
|
exportedApp.AppState = genesis
|
||||||
exportedApp.Height = int64(latestHeight)
|
exportedApp.Height = int64(latestHeight)
|
||||||
|
if forZeroHeight {
|
||||||
|
exportedApp.Height = 0
|
||||||
|
}
|
||||||
|
|
||||||
return exportedApp, nil
|
return exportedApp, nil
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,12 @@ func InitRootCmd[T app.Tx](
|
|||||||
app.Name(),
|
app.Name(),
|
||||||
app.Store(),
|
app.Store(),
|
||||||
app.App.AppManager,
|
app.App.AppManager,
|
||||||
app.AppCodec(),
|
cometbft.AppCodecs[T]{
|
||||||
&client.DefaultTxDecoder[T]{TxConfig: deps.TxConfig},
|
AppCodec: app.AppCodec(),
|
||||||
|
TxCodec: &client.DefaultTxDecoder[T]{TxConfig: deps.TxConfig},
|
||||||
|
LegacyAmino: deps.ClientContext.LegacyAmino,
|
||||||
|
ConsensusAddressCodec: deps.ClientContext.ConsensusAddressCodec,
|
||||||
|
},
|
||||||
app.App.QueryHandlers(),
|
app.App.QueryHandlers(),
|
||||||
app.App.SchemaDecoderResolver(),
|
app.App.SchemaDecoderResolver(),
|
||||||
initCometOptions[T](),
|
initCometOptions[T](),
|
||||||
|
Loading…
Reference in New Issue
Block a user