Skip to content

Commit

Permalink
refactor encoding.go (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
SihanoukSolver29 authored Dec 24, 2024
1 parent e0e3c76 commit 3eeedcc
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,20 @@ import (
oracleconfig "github.com/skip-mev/connect/v2/oracle/config"
)

func newTempApp() *InitiaApp {
return NewInitiaApp(
log.NewNopLogger(),
dbm.NewMemDB(),
nil,
true,
moveconfig.DefaultMoveConfig(),
oracleconfig.NewDefaultAppConfig(),
EmptyAppOptions{},
)
}

func MakeEncodingConfig() params.EncodingConfig {
tempApp := NewInitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, moveconfig.DefaultMoveConfig(), oracleconfig.NewDefaultAppConfig(), EmptyAppOptions{})
tempApp := newTempApp()
encodingConfig := params.EncodingConfig{
InterfaceRegistry: tempApp.InterfaceRegistry(),
Codec: tempApp.AppCodec(),
Expand All @@ -30,7 +42,7 @@ func MakeEncodingConfig() params.EncodingConfig {
}

func AutoCliOpts() autocli.AppOptions {
tempApp := NewInitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, moveconfig.DefaultMoveConfig(), oracleconfig.NewDefaultAppConfig(), EmptyAppOptions{})
tempApp := newTempApp()
modules := make(map[string]appmodule.AppModule, 0)
for _, m := range tempApp.ModuleManager.Modules {
if moduleWithName, ok := m.(module.HasName); ok {
Expand All @@ -51,7 +63,7 @@ func AutoCliOpts() autocli.AppOptions {
}

func BasicManager() module.BasicManager {
tempApp := NewInitiaApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, moveconfig.DefaultMoveConfig(), oracleconfig.NewDefaultAppConfig(), EmptyAppOptions{})
tempApp := newTempApp()
return tempApp.BasicModuleManager
}

Expand Down

0 comments on commit 3eeedcc

Please sign in to comment.