Documentation ¶
Overview ¶
Package scaffolder initializes Spellshape CLI apps and modifies existing ones to add more features in a later time.
Index ¶
- func Init(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (path string, err error)
- type AddTypeKind
- type AddTypeOption
- type MessageOption
- type ModuleCreationOption
- type OracleOption
- type PacketOption
- type Scaffolder
- func (s Scaffolder) AddMessage(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (sm xgenny.SourceModification, err error)
- func (s *Scaffolder) AddOracle(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (sm xgenny.SourceModification, err error)deprecated
- func (s Scaffolder) AddPacket(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (sm xgenny.SourceModification, err error)
- func (s Scaffolder) AddQuery(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (sm xgenny.SourceModification, err error)
- func (s Scaffolder) AddType(ctx context.Context, cacheStorage cache.Storage, typeName string, ...) (sm xgenny.SourceModification, err error)
- func (s Scaffolder) CreateModule(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (sm xgenny.SourceModification, err error)
- func (s Scaffolder) ImportModule(ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, ...) (sm xgenny.SourceModification, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddTypeKind ¶
type AddTypeKind func(*addTypeOptions)
AddTypeKind configures the type kind option for AddType.
func ListType ¶
func ListType() AddTypeKind
ListType makes the type stored in a list convention in the storage.
func MapType ¶
func MapType(indexes ...string) AddTypeKind
MapType makes the type stored in a key-value convention in the storage with a custom index option.
func SingletonType ¶
func SingletonType() AddTypeKind
SingletonType makes the type stored in a fixed place as a single entry in the storage.
type AddTypeOption ¶
type AddTypeOption func(*addTypeOptions)
AddTypeOption configures options for AddType.
func TypeWithFields ¶
func TypeWithFields(fields ...string) AddTypeOption
TypeWithFields adds fields to the type to be scaffolded.
func TypeWithModule ¶
func TypeWithModule(name string) AddTypeOption
TypeWithModule module to scaffold type into.
func TypeWithSigner ¶
func TypeWithSigner(signer string) AddTypeOption
TypeWithSigner provides a custom signer name for the message.
func TypeWithoutMessage ¶
func TypeWithoutMessage() AddTypeOption
TypeWithoutMessage disables generating sdk compatible messages and tx related APIs.
func TypeWithoutSimulation ¶
func TypeWithoutSimulation() AddTypeOption
TypeWithoutSimulation disables generating messages simulation.
type MessageOption ¶
type MessageOption func(*messageOptions)
MessageOption configures the message scaffolding.
func WithDescription ¶
func WithDescription(desc string) MessageOption
WithDescription provides a custom description for the message CLI command.
func WithSigner ¶
func WithSigner(signer string) MessageOption
WithSigner provides a custom signer name for the message.
func WithoutSimulation ¶
func WithoutSimulation() MessageOption
WithoutSimulation disables generating messages simulation.
type ModuleCreationOption ¶
type ModuleCreationOption func(*moduleCreationOptions)
ModuleCreationOption configures Chain.
func WithDependencies ¶
func WithDependencies(dependencies []modulecreate.Dependency) ModuleCreationOption
WithDependencies specifies the name of the modules that the module depends on.
func WithIBCChannelOrdering ¶
func WithIBCChannelOrdering(ordering string) ModuleCreationOption
WithIBCChannelOrdering configures channel ordering of the IBC module.
func WithParams ¶
func WithParams(params []string) ModuleCreationOption
WithParams scaffolds a module with params.
type OracleOption ¶
type OracleOption func(*oracleOptions)
OracleOption configures options for AddOracle.
func OracleWithSigner
deprecated
func OracleWithSigner(signer string) OracleOption
OracleWithSigner provides a custom signer name for the message
Deprecated: This function is no longer maintained.
type PacketOption ¶
type PacketOption func(*packetOptions)
PacketOption configures the packet scaffolding.
func PacketWithSigner ¶
func PacketWithSigner(signer string) PacketOption
PacketWithSigner provides a custom signer name for the packet.
func PacketWithoutMessage ¶
func PacketWithoutMessage() PacketOption
PacketWithoutMessage disables generating sdk compatible messages and tx related APIs.
type Scaffolder ¶
type Scaffolder struct { // Version of the chain Version cosmosver.Version // contains filtered or unexported fields }
Scaffolder is Spellshape CLI app scaffolder.
func (Scaffolder) AddMessage ¶
func (s Scaffolder) AddMessage( ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, moduleName, msgName string, fields, resFields []string, options ...MessageOption, ) (sm xgenny.SourceModification, err error)
AddMessage adds a new message to scaffolded app.
func (*Scaffolder) AddOracle
deprecated
func (s *Scaffolder) AddOracle( ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, moduleName, queryName string, options ...OracleOption, ) (sm xgenny.SourceModification, err error)
AddOracle adds a new BandChain oracle envtest.
Deprecated: This function is no longer maintained.
func (Scaffolder) AddPacket ¶
func (s Scaffolder) AddPacket( ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, moduleName, packetName string, packetFields, ackFields []string, options ...PacketOption, ) (sm xgenny.SourceModification, err error)
AddPacket adds a new type stype to scaffolded app by using optional type fields.
func (Scaffolder) AddQuery ¶
func (s Scaffolder) AddQuery( ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, moduleName, queryName, description string, reqFields, resFields []string, paginated bool, ) (sm xgenny.SourceModification, err error)
AddQuery adds a new query to scaffolded app.
func (Scaffolder) AddType ¶
func (s Scaffolder) AddType( ctx context.Context, cacheStorage cache.Storage, typeName string, tracer *placeholder.Tracer, kind AddTypeKind, options ...AddTypeOption, ) (sm xgenny.SourceModification, err error)
AddType adds a new type to a scaffolded app. if none of the list, map or singleton given, a dry type without anything extra (like a storage layer, models, CLI etc.) will be scaffolded. if no module is given, the type will be scaffolded inside the app's default module.
func (Scaffolder) CreateModule ¶
func (s Scaffolder) CreateModule( ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, moduleName string, options ...ModuleCreationOption, ) (sm xgenny.SourceModification, err error)
CreateModule creates a new empty module in the scaffolded app.
func (Scaffolder) ImportModule ¶
func (s Scaffolder) ImportModule( ctx context.Context, cacheStorage cache.Storage, tracer *placeholder.Tracer, name string, ) (sm xgenny.SourceModification, err error)
ImportModule imports specified module with name to the scaffolded app.