tx

package
v0.0.0-...-54b49d4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 29 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBankKeeperCoinMetadataQueryFn

func NewBankKeeperCoinMetadataQueryFn(bk BankKeeper) textual.CoinMetadataQueryFn

NewBankKeeperCoinMetadataQueryFn creates a new Textual struct using the given BankKeeper to retrieve coin metadata.

This function should be used in the server (app.go) and is already injected thanks to app wiring for app_di.

func NewGRPCCoinMetadataQueryFn

func NewGRPCCoinMetadataQueryFn(grpcConn grpc.ClientConnInterface) textual.CoinMetadataQueryFn

NewGRPCCoinMetadataQueryFn returns a new Textual instance where the metadata queries are done via gRPC using the provided GRPC client connection. In the SDK, you can pass a client.Context as the GRPC connection.

Example:

clientCtx := client.GetClientContextFromCmd(cmd)
txt := tx.NewTextualWithGRPCConn(clientCtx)

This should be used in the client (root.go) of an application.

func ProvideProtoRegistry

func ProvideProtoRegistry() txsigning.ProtoFileResolver

Types

type AppModule

type AppModule struct {
	// contains filtered or unexported fields
}

AppModule is a module that only implements tx validators. The goal of this module is to allow extensible registration of tx validators provided by chains without requiring a new modules. Additionally, it registers tx validators that do not really have a place in other modules. This module is only useful for chains using server/v2. Ante/Post handlers are setup via baseapp options in depinject.

func NewAppModule

func NewAppModule(
	sigVerification ante.SigVerificationDecorator,
	feeTxValidator *ante.DeductFeeDecorator,
	unorderTxValidator *ante.UnorderedTxDecorator,
	txValidators ...appmodulev2.TxValidator[transaction.Tx],
) AppModule

NewAppModule creates a new AppModule object.

func (AppModule) IsAppModule

func (a AppModule) IsAppModule()

IsAppModule implements appmodule.AppModule.

func (AppModule) IsOnePerModuleType

func (a AppModule) IsOnePerModuleType()

IsOnePerModuleType implements appmodule.AppModule.

func (AppModule) TxValidator

func (a AppModule) TxValidator(ctx context.Context, tx transaction.Tx) error

TxValidator implements appmodule.HasTxValidator.

type BankKeeper

type BankKeeper interface {
	DenomMetadataV2(c context.Context, req *bankv1beta1.QueryDenomMetadataRequest) (*bankv1beta1.QueryDenomMetadataResponse, error)
}

BankKeeper defines the contract needed for tx-related APIs

type ModuleInputs

type ModuleInputs struct {
	depinject.In

	Config                *txconfigv1.Config
	AddressCodec          address.Codec
	ValidatorAddressCodec address.ValidatorAddressCodec
	Codec                 codec.Codec
	ProtoFileResolver     txsigning.ProtoFileResolver
	Environment           appmodule.Environment
	// BankKeeper is the expected bank keeper to be passed to AnteHandlers / Tx Validators
	BankKeeper               authtypes.BankKeeper                    `optional:"true"`
	MetadataBankKeeper       BankKeeper                              `optional:"true"`
	AccountKeeper            ante.AccountKeeper                      `optional:"true"`
	FeeGrantKeeper           ante.FeegrantKeeper                     `optional:"true"`
	AccountAbstractionKeeper ante.AccountAbstractionKeeper           `optional:"true"`
	CustomSignModeHandlers   func() []txsigning.SignModeHandler      `optional:"true"`
	CustomGetSigners         []txsigning.CustomGetSigner             `optional:"true"`
	ExtraTxValidators        []appmodule.TxValidator[transaction.Tx] `optional:"true"`
	UnorderedTxManager       *unorderedtx.Manager                    `optional:"true"`
	TxFeeChecker             ante.TxFeeChecker                       `optional:"true"`
	Viper                    *viper.Viper                            `optional:"true"` // server v2
}

type ModuleOutputs

type ModuleOutputs struct {
	depinject.Out

	Module          appmodule.AppModule   // This is only useful for chains using server/v2. It setup tx validators that don't belong to other modules.
	BaseAppOption   runtime.BaseAppOption // This is only useful for chains using baseapp. Server/v2 chains use TxValidator.
	TxConfig        client.TxConfig
	TxConfigOptions tx.ConfigOptions
}

func ProvideModule

func ProvideModule(in ModuleInputs) ModuleOutputs

Jump to

Keyboard shortcuts

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