MCPcopy Create free account
hub / github.com/Sifchain/sifnode / createSimappAndExport

Function createSimappAndExport

cmd/sifnoded/cmd/root.go:190–204  ·  view source on GitHub ↗
(logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool,
	jailAllowedAddrs []string, appOpts servertypes.AppOptions)

Source from the content-addressed store, hash-verified

188}
189
190func createSimappAndExport(logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool,
191 jailAllowedAddrs []string, appOpts servertypes.AppOptions) (servertypes.ExportedApp, error) {
192 encCfg := app.MakeTestEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd.
193 encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry)
194 var sifApp *app.SifchainApp
195 if height != -1 {
196 sifApp = app.NewSifApp(logger, db, traceStore, false, map[int64]bool{}, "", cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), encCfg, appOpts)
197 if err := sifApp.LoadHeight(height); err != nil {
198 return servertypes.ExportedApp{}, err
199 }
200 } else {
201 sifApp = app.NewSifApp(logger, db, traceStore, true, map[int64]bool{}, "", cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), encCfg, appOpts)
202 }
203 return sifApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs)
204}

Callers

nothing calls this directly

Calls 5

LoadHeightMethod · 0.95
MakeTestEncodingConfigFunction · 0.92
NewSifAppFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected