modulecreate

package
v28.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMsgServerConventionToLegacyModule

func AddMsgServerConventionToLegacyModule(replacer placeholder.Replacer, opts *MsgServerOptions) (*genny.Generator, error)

AddMsgServerConventionToLegacyModule add the files and the necessary modifications to an existing module that doesn't support MsgServer convention https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-031-msg-service.md

func NewAppModify

func NewAppModify(replacer placeholder.Replacer, opts *CreateOptions) *genny.Generator

NewAppModify returns generator with modifications required to register a module in the app.

func NewGenerator

func NewGenerator(opts *CreateOptions) (*genny.Generator, error)

NewGenerator returns the generator to scaffold a module inside an app.

func NewIBC

func NewIBC(replacer placeholder.Replacer, opts *CreateOptions) (*genny.Generator, error)

NewIBC returns the generator to scaffold the implementation of the IBCModule interface inside a module.

Types

type CreateOptions

type CreateOptions struct {
	ModuleName string
	ModulePath string
	AppName    string
	AppPath    string
	Params     field.Fields

	// True if the module should implement the IBC module interface
	IsIBC bool

	// Channel ordering of the IBC module: ordered, unordered or none
	IBCOrdering string

	// Dependencies of the module
	Dependencies Dependencies
}

CreateOptions represents the options to scaffold a Cosmos SDK module.

func (*CreateOptions) Validate

func (opts *CreateOptions) Validate() error

Validate that options are usable.

type Dependencies

type Dependencies []Dependency

Dependencies represents a list of module dependency.

func (Dependencies) Contains

func (d Dependencies) Contains(name string) bool

Contains returns true if contains dependency name.

func (Dependencies) Len

func (d Dependencies) Len() int

Len returns the length of dependencies.

type Dependency

type Dependency struct {
	Name string
}

Dependency represents a module dependency of a module.

func NewDependency

func NewDependency(name string) Dependency

NewDependency returns a new dependency.

func (Dependency) KeeperName

func (d Dependency) KeeperName() string

KeeperName returns the keeper's name for the dependency module.

type MsgServerOptions

type MsgServerOptions struct {
	ModuleName string
	ModulePath string
	AppName    string
	AppPath    string
}

MsgServerOptions defines options to add MsgServer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL