Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/tutorials/nameservic…
Browse files Browse the repository at this point in the history
…e/base/github.com/dvsekhvalnov/jose2go-1.6.0
  • Loading branch information
samricotta authored May 3, 2024
2 parents 325d93c + 8edd000 commit 66bbe8c
Show file tree
Hide file tree
Showing 96 changed files with 13,953 additions and 695 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CODEOWNERS: <https://help.github.com/articles/about-codeowners/>

@samricotta
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/tutoriald
build/exampled
build/
data/
config/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The published content currently lives in a few separate folders:

Meet the people [behind the Cosmos SDK and contributors](https://github.com/cosmos/sdk-tutorials/graphs/contributors).

## Viewing Tutorial Builds
## Viewing Example Builds

There are two ways to see what your changes will look like in production before the updated pages are published:

Expand Down
8 changes: 4 additions & 4 deletions tutorials/base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ifeq (,$(VERSION))
endif

# Update the ldflags with the app, client & server names
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=tutorial \
-X github.com/cosmos/cosmos-sdk/version.AppName=tutoriald \
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=example \
-X github.com/cosmos/cosmos-sdk/version.AppName=exampled \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)

Expand All @@ -27,8 +27,8 @@ all: install
install:
@echo "--> ensure dependencies have not been modified"
@go mod verify
@echo "--> installing tutoriald"
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/tutoriald
@echo "--> installing exampled"
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/exampled

init:
./scripts/init.sh
30 changes: 15 additions & 15 deletions tutorials/base/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ var DefaultNodeHome string
var AppConfigYAML []byte

var (
_ runtime.AppI = (*TutorialApp)(nil)
_ servertypes.Application = (*TutorialApp)(nil)
_ runtime.AppI = (*ExampleApp)(nil)
_ servertypes.Application = (*ExampleApp)(nil)
)

// TutorialApp extends an ABCI application, but with most of its parameters exported.
// ExampleApp extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
type TutorialApp struct {
type ExampleApp struct {
*runtime.App
legacyAmino *codec.LegacyAmino
appCodec codec.Codec
Expand All @@ -76,7 +76,7 @@ func init() {
panic(err)
}

DefaultNodeHome = filepath.Join(userHomeDir, ".tutoriald")
DefaultNodeHome = filepath.Join(userHomeDir, ".exampled")
}

// AppConfig returns the default app config.
Expand All @@ -92,17 +92,17 @@ func AppConfig() depinject.Config {
)
}

// NewTutorialApp returns a reference to an initialized tutorialApp.
func NewTutorialApp(
// NewExampleApp returns a reference to an initialized ExampleApp.
func NewExampleApp(
logger log.Logger,
db dbm.DB,
traceStore io.Writer,
loadLatest bool,
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) (*TutorialApp, error) {
) (*ExampleApp, error) {
var (
app = &TutorialApp{}
app = &ExampleApp{}
appBuilder *runtime.AppBuilder
)

Expand Down Expand Up @@ -149,13 +149,13 @@ func NewTutorialApp(
return app, nil
}

// LegacyAmino returns tutorialApp's amino codec.
func (app *TutorialApp) LegacyAmino() *codec.LegacyAmino {
// LegacyAmino returns ExampleApp's amino codec.
func (app *ExampleApp) LegacyAmino() *codec.LegacyAmino {
return app.legacyAmino
}

// GetKey returns the KVStoreKey for the provided store key.
func (app *TutorialApp) GetKey(storeKey string) *storetypes.KVStoreKey {
func (app *ExampleApp) GetKey(storeKey string) *storetypes.KVStoreKey {
sk := app.UnsafeFindStoreKey(storeKey)
kvStoreKey, ok := sk.(*storetypes.KVStoreKey)
if !ok {
Expand All @@ -164,7 +164,7 @@ func (app *TutorialApp) GetKey(storeKey string) *storetypes.KVStoreKey {
return kvStoreKey
}

func (app *TutorialApp) kvStoreKeys() map[string]*storetypes.KVStoreKey {
func (app *ExampleApp) kvStoreKeys() map[string]*storetypes.KVStoreKey {
keys := make(map[string]*storetypes.KVStoreKey)
for _, k := range app.GetStoreKeys() {
if kv, ok := k.(*storetypes.KVStoreKey); ok {
Expand All @@ -176,13 +176,13 @@ func (app *TutorialApp) kvStoreKeys() map[string]*storetypes.KVStoreKey {
}

// SimulationManager implements the SimulationApp interface
func (app *TutorialApp) SimulationManager() *module.SimulationManager {
func (app *ExampleApp) SimulationManager() *module.SimulationManager {
return app.sm
}

// RegisterAPIRoutes registers all application module routes with the provided
// API server.
func (app *TutorialApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
func (app *ExampleApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
app.App.RegisterAPIRoutes(apiSvr, apiConfig)
// register swagger API in app.go so that other applications can override easily
if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion tutorials/base/app/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ modules:
- name: runtime
config:
"@type": cosmos.app.runtime.v1alpha1.Module
app_name: TutorialApp
app_name: ExampleApp
# During begin block slashing happens after distr.BeginBlocker so that
# there is nothing left over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant.
# NOTE: staking module is required if HistoricalEntries param > 0
Expand Down
4 changes: 2 additions & 2 deletions tutorials/base/app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// ExportAppStateAndValidators exports the state of the application for a genesis file.
func (app *TutorialApp) ExportAppStateAndValidators(
func (app *ExampleApp) ExportAppStateAndValidators(
forZeroHeight bool,
jailAllowedAddrs []string,
modulesToExport []string,
Expand Down Expand Up @@ -52,7 +52,7 @@ func (app *TutorialApp) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature, which will be deprecated in favor of export at a block height
func (app *TutorialApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
func (app *ExampleApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

// check if there is a allowed address list
Expand Down
4 changes: 2 additions & 2 deletions tutorials/base/app/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
)

const (
CoinUnit = "tutorial"
CoinUnit = "example"

DefaultBondDenom = CoinUnit

// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
Bech32PrefixAccAddr = "tutorial"
Bech32PrefixAccAddr = "example"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func txCommand() *cobra.Command {
// newApp is an appCreator
func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application {
baseappOptions := server.DefaultBaseappOptions(appOpts)
app, err := app.NewTutorialApp(logger, db, traceStore, true, appOpts, baseappOptions...)
app, err := app.NewExampleApp(logger, db, traceStore, true, appOpts, baseappOptions...)
if err != nil {
panic(err)
}
Expand All @@ -119,8 +119,8 @@ func appExport(
modulesToExport []string,
) (servertypes.ExportedApp, error) {
var (
tutorialApp *app.TutorialApp
err error
ExampleApp *app.ExampleApp
err error
)

// this check is necessary as we use the flag in x/upgrade.
Expand All @@ -140,20 +140,20 @@ func appExport(
appOpts = viperAppOpts

if height != -1 {
tutorialApp, err = app.NewTutorialApp(logger, db, traceStore, false, appOpts)
ExampleApp, err = app.NewExampleApp(logger, db, traceStore, false, appOpts)
if err != nil {
return servertypes.ExportedApp{}, err
}

if err := tutorialApp.LoadHeight(height); err != nil {
if err := ExampleApp.LoadHeight(height); err != nil {
return servertypes.ExportedApp{}, err
}
} else {
tutorialApp, err = app.NewTutorialApp(logger, db, traceStore, true, appOpts)
ExampleApp, err = app.NewExampleApp(logger, db, traceStore, true, appOpts)
if err != nil {
return servertypes.ExportedApp{}, err
}
}

return tutorialApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
return ExampleApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/cosmos/sdk-tutorials/tutorials/base/app"
)

// NewRootCmd creates a new root command for tutoriald. It is called once in the
// NewRootCmd creates a new root command for exampled. It is called once in the
// main function.
func NewRootCmd() *cobra.Command {
var (
Expand Down Expand Up @@ -60,8 +60,8 @@ func NewRootCmd() *cobra.Command {
}

rootCmd := &cobra.Command{
Use: "tutoriald",
Short: "tutoriald - the tutorial chain app",
Use: "exampled",
Short: "exampled - the example chain app",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs
cmd.SetOut(cmd.OutOrStdout())
Expand Down Expand Up @@ -101,7 +101,7 @@ func NewRootCmd() *cobra.Command {

// overwrite the minimum gas price from the app configuration
srvCfg := serverconfig.DefaultConfig()
srvCfg.MinGasPrices = "0tutorial"
srvCfg.MinGasPrices = "0example"

// overwrite the block timeout
cmtCfg := cmtcfg.DefaultConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/cosmos/sdk-tutorials/tutorials/base/app"
"github.com/cosmos/sdk-tutorials/tutorials/base/app/params"
"github.com/cosmos/sdk-tutorials/tutorials/base/cmd/tutoriald/cmd"
"github.com/cosmos/sdk-tutorials/tutorials/base/cmd/exampled/cmd"
)

func main() {
Expand Down
43 changes: 23 additions & 20 deletions tutorials/base/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ require (
github.com/creachadair/atomicfile v0.3.1 // indirect
github.com/creachadair/tomledit v0.0.24 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
)

require (
Expand Down Expand Up @@ -39,7 +43,7 @@ require (
github.com/cockroachdb/pebble v0.0.0-20231101195458-481da04154d6 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft v0.38.2
github.com/cometbft/cometbft v0.38.6
github.com/cometbft/cometbft-db v0.9.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.0.0
Expand All @@ -51,7 +55,7 @@ require (
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
Expand All @@ -62,7 +66,7 @@ require (
github.com/emicklei/dot v1.6.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.25.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand Down Expand Up @@ -114,7 +118,7 @@ require (
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
Expand All @@ -124,32 +128,31 @@ require (
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.31.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0
github.com/spf13/viper v1.18.1
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.60.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 66bbe8c

Please sign in to comment.