From 64489735c3476882d1dbc41baa0a00e6fd5af7ed Mon Sep 17 00:00:00 2001 From: philipsu522 Date: Tue, 24 May 2022 10:14:30 -0700 Subject: [PATCH 1/3] Fix address prefix to sei --- app/app.go | 13 ++++--------- app/const.go | 8 ++++++++ cmd/sei-chaind/main.go | 4 ++-- cmd/sei-chaind/root.go | 4 ++-- 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 app/const.go diff --git a/app/app.go b/app/app.go index 3bc2942df9..3fe4fdf9a1 100644 --- a/app/app.go +++ b/app/app.go @@ -117,11 +117,6 @@ import ( "go.opentelemetry.io/otel" ) -const ( - AccountAddressPrefix = "cosmos" - Name = "sei-chain" -) - // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals func getGovProposalHandlers() []govclient.ProposalHandler { @@ -202,7 +197,7 @@ func init() { panic(err) } - DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) + DefaultNodeHome = filepath.Join(userHomeDir, "."+AppName) } // App extends an ABCI application, but with most of its parameters exported. @@ -279,7 +274,7 @@ func New( cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry - bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + bApp := baseapp.NewBaseApp(AppName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) @@ -667,7 +662,7 @@ func New( return app } -// Name returns the name of the App +// AppName returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } // GetBaseApp returns the base app of the application @@ -780,7 +775,7 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig // register app's OpenAPI routes. apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) - apiSvr.Router.HandleFunc("/", openapiconsole.Handler(Name, "/static/openapi.yml")) + apiSvr.Router.HandleFunc("/", openapiconsole.Handler(AppName, "/static/openapi.yml")) } // RegisterTxService implements the Application.RegisterTxService method. diff --git a/app/const.go b/app/const.go new file mode 100644 index 0000000000..24b85d5996 --- /dev/null +++ b/app/const.go @@ -0,0 +1,8 @@ +package app + +const ( + // Prefix of bech32 encoded address + AccountAddressPrefix = "sei" + // Application name + AppName = "sei-chain" +) diff --git a/cmd/sei-chaind/main.go b/cmd/sei-chaind/main.go index f1f94ff16c..1b52ffbafd 100644 --- a/cmd/sei-chaind/main.go +++ b/cmd/sei-chaind/main.go @@ -9,10 +9,10 @@ import ( func main() { rootCmd, _ := NewRootCmd( - app.Name, + app.AppName, app.AccountAddressPrefix, app.DefaultNodeHome, - app.Name, + app.AppName, app.ModuleBasics, app.New, // this line is used by starport scaffolding # root/arguments diff --git a/cmd/sei-chaind/root.go b/cmd/sei-chaind/root.go index 59c88cbf4c..04572c870a 100644 --- a/cmd/sei-chaind/root.go +++ b/cmd/sei-chaind/root.go @@ -131,8 +131,8 @@ func NewRootCmd( WithViper(rootOptions.envPrefix) rootCmd := &cobra.Command{ - Use: appName + "d", - Short: "Stargate CosmosHub App", + Use: "seid", + Short: "Stargate Sei App", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) From 534e75db8c7bf92fed373f7b07d1a38b34fb47c7 Mon Sep 17 00:00:00 2001 From: philipsu522 Date: Tue, 24 May 2022 10:14:30 -0700 Subject: [PATCH 2/3] Fix address prefix to sei --- app/app.go | 13 ++++--------- app/const.go | 8 ++++++++ cmd/seid/main.go | 4 ++-- cmd/seid/root.go | 4 ++-- 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 app/const.go diff --git a/app/app.go b/app/app.go index 9e76ca36c2..3e94f42eaf 100644 --- a/app/app.go +++ b/app/app.go @@ -118,11 +118,6 @@ import ( "go.opentelemetry.io/otel" ) -const ( - AccountAddressPrefix = "cosmos" - Name = "sei" -) - // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals func getGovProposalHandlers() []govclient.ProposalHandler { @@ -203,7 +198,7 @@ func init() { panic(err) } - DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) + DefaultNodeHome = filepath.Join(userHomeDir, "."+AppName) } // App extends an ABCI application, but with most of its parameters exported. @@ -281,7 +276,7 @@ func New( cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry - bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + bApp := baseapp.NewBaseApp(AppName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) @@ -684,7 +679,7 @@ func New( return app } -// Name returns the name of the App +// AppName returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } // GetBaseApp returns the base app of the application @@ -797,7 +792,7 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig // register app's OpenAPI routes. apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) - apiSvr.Router.HandleFunc("/", openapiconsole.Handler(Name, "/static/openapi.yml")) + apiSvr.Router.HandleFunc("/", openapiconsole.Handler(AppName, "/static/openapi.yml")) } // RegisterTxService implements the Application.RegisterTxService method. diff --git a/app/const.go b/app/const.go new file mode 100644 index 0000000000..4e3cb4999a --- /dev/null +++ b/app/const.go @@ -0,0 +1,8 @@ +package app + +const ( + // Prefix of bech32 encoded address + AccountAddressPrefix = "sei" + // Application name + AppName = "sei" +) diff --git a/cmd/seid/main.go b/cmd/seid/main.go index f1f94ff16c..1b52ffbafd 100644 --- a/cmd/seid/main.go +++ b/cmd/seid/main.go @@ -9,10 +9,10 @@ import ( func main() { rootCmd, _ := NewRootCmd( - app.Name, + app.AppName, app.AccountAddressPrefix, app.DefaultNodeHome, - app.Name, + app.AppName, app.ModuleBasics, app.New, // this line is used by starport scaffolding # root/arguments diff --git a/cmd/seid/root.go b/cmd/seid/root.go index 59c88cbf4c..04572c870a 100644 --- a/cmd/seid/root.go +++ b/cmd/seid/root.go @@ -131,8 +131,8 @@ func NewRootCmd( WithViper(rootOptions.envPrefix) rootCmd := &cobra.Command{ - Use: appName + "d", - Short: "Stargate CosmosHub App", + Use: "seid", + Short: "Stargate Sei App", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) From 3e6fc2392b8e35598e291f52f7b3b4b314476ee9 Mon Sep 17 00:00:00 2001 From: philipsu522 Date: Wed, 25 May 2022 12:05:34 -0700 Subject: [PATCH 3/3] nit fix --- cmd/seid/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/seid/root.go b/cmd/seid/root.go index 04572c870a..980d9e460a 100644 --- a/cmd/seid/root.go +++ b/cmd/seid/root.go @@ -131,7 +131,7 @@ func NewRootCmd( WithViper(rootOptions.envPrefix) rootCmd := &cobra.Command{ - Use: "seid", + Use: appName + "d", Short: "Stargate Sei App", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs