app

package
v8.0.0-...-5471dbc Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 146 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxClassIDLength values chosen arbitrarily
	MaxClassIDLength      = 2048
	MaxTokenIds           = 256
	MaxTokenIDLength      = 2048
	MaximumReceiverLength = 2048
)

Variables

View Source
var CircuitSuperAdmins = map[string][]string{
	"chaintest": {
		"cro1jgt29q28ehyc6p0fd5wqhwswfxv59lhppz3v65",
		"cro1sjcrmp0ngft2n2r3r4gcva4llfj8vjdnefdg4m",
	},
	"testnet-croeseid-4": {
		"tcro14thaw89nlpp8hjm83z6zp3w5ymlpgg2zejncw7",
		"tcro19uhea66tnx78r5258sq5vdad8msk47w6vn8f06",
	},
	"crypto-org-chain-mainnet-dryrun-1": {
		"cro1h704kvqdh48jzge7vvxpej9d6r9usvssehmxac",
		"cro1gv6e77tq7l06904g9nuu4nvnwcynaannwjpuaj",
		"cro160rhmah7kmfy9vg9jklkdqyv6nu9j7jnjpun9j",
	},
	"crypto-org-chain-mainnet-1": {
		"cro160rhmah7kmfy9vg9jklkdqyv6nu9j7jnjpun9j",
	},
}

CircuitSuperAdmins maps chain IDs to their super admin addresses

View Source
var (
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome string
)

Functions

func DecToDuration

func DecToDuration(d sdkmath.LegacyDec) time.Duration

func DefaultPeriodRatio

func DefaultPeriodRatio() sdkmath.LegacyDec

func DefaultThresholdRatio

func DefaultThresholdRatio() sdkmath.LegacyDec

func DurationToDec

func DurationToDec(d time.Duration) sdkmath.LegacyDec

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

func RegisterSwaggerAPI

func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

func StoreKeys

StoreKeys returns all the store keys to register in current app

func UpdateExpeditedParams

func UpdateExpeditedParams(ctx context.Context, gov govkeeper.Keeper) error

Types

type App

type App interface {
	// The assigned name of the app.
	Name() string

	// The application types codec.
	// NOTE: This should be sealed before being returned.
	LegacyAmino() *codec.LegacyAmino

	// Application updates every begin block.
	BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)

	// Application updates every end block.
	EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)

	// Application update at chain (i.e app) initialization.
	InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)

	// Loads the app at a given height.
	LoadHeight(height int64) error

	// Exports the state of the application for a genesis file.
	ExportAppStateAndValidators(
		forZeroHeight bool, jailAllowedAddrs, modulesToExport []string,
	) (servertypes.ExportedApp, error)

	// All the registered module account addresses.
	ModuleAccountAddrs() map[string]bool
}

App implements the common methods for a Cosmos SDK-based application specific blockchain. (Amino is still needed for Ledger at the moment)

type ChainApp

type ChainApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.Keeper
	StakingKeeper         *stakingkeeper.Keeper
	SlashingKeeper        slashingkeeper.Keeper
	MintKeeper            mintkeeper.Keeper
	DistrKeeper           distrkeeper.Keeper
	GovKeeper             govkeeper.Keeper
	UpgradeKeeper         upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper
	IBCKeeper             *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	ICAControllerKeeper   icacontrollerkeeper.Keeper
	ICAHostKeeper         icahostkeeper.Keeper
	AuthzKeeper           authzkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	GroupKeeper           groupkeeper.Keeper
	TransferKeeper        ibctransferkeeper.Keeper
	NFTTransferKeeper     nfttransferkeeper.Keeper

	SupplyKeeper    supplykeeper.Keeper
	NFTKeeper       nftkeeper.Keeper
	CircuitKeeper   circuitkeeper.Keeper
	MaxSupplyKeeper maxsupplykeeper.Keeper

	// the module manager
	ModuleManager      *module.Manager
	BasicModuleManager module.BasicManager
	// contains filtered or unexported fields
}

ChainApp 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. (Amino is still needed for Ledger at the moment)

func New

func New(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	appOpts servertypes.AppOptions,
	baseAppOptions ...func(*baseapp.BaseApp),
) *ChainApp

New returns a reference to an initialized Chain.

func (*ChainApp) AppCodec

func (app *ChainApp) AppCodec() codec.Codec

AppCodec returns Chain's app codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*ChainApp) AutoCliOpts

func (app *ChainApp) AutoCliOpts() autocli.AppOptions

AutoCliOpts returns the autocli options for the app.

func (*ChainApp) BeginBlocker

func (app *ChainApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)

BeginBlocker application updates every begin block

func (*ChainApp) BlockedAddrs

func (app *ChainApp) BlockedAddrs() map[string]bool

BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.

func (*ChainApp) Close

func (app *ChainApp) Close() error

Close will be called in graceful shutdown in start cmd

func (*ChainApp) DefaultGenesis

func (app *ChainApp) DefaultGenesis() map[string]json.RawMessage

DefaultGenesis returns a default genesis from the registered AppModuleBasic's.

func (*ChainApp) EncodingConfig

func (app *ChainApp) EncodingConfig() appparams.EncodingConfig

func (*ChainApp) EndBlocker

func (app *ChainApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)

EndBlocker application updates every end block

func (*ChainApp) ExportAppStateAndValidators

func (app *ChainApp) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs, modulesToExport []string,
) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*ChainApp) GetKey

func (app *ChainApp) GetKey(storeKey string) *storetypes.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*ChainApp) GetMemKey

func (app *ChainApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*ChainApp) GetSubspace

func (app *ChainApp) GetSubspace(moduleName string) paramstypes.Subspace

GetSubspace returns a param subspace for a given module name.

NOTE: This is solely to be used for testing purposes.

func (*ChainApp) GetTKey

func (app *ChainApp) GetTKey(storeKey string) *storetypes.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*ChainApp) InitChainer

func (app *ChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)

InitChainer application update at chain initialization

func (*ChainApp) InterfaceRegistry

func (app *ChainApp) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns Chain's InterfaceRegistry

func (*ChainApp) LegacyAmino

func (app *ChainApp) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns ChainApp's amino codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types. (Amino is still needed for Ledger at the moment)

func (*ChainApp) LoadHeight

func (app *ChainApp) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*ChainApp) ModuleAccountAddrs

func (app *ChainApp) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*ChainApp) Name

func (app *ChainApp) Name() string

Name returns the name of the App

func (*ChainApp) PreBlocker

func (app *ChainApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)

PreBlocker updates every pre begin block

func (*ChainApp) RegisterAPIRoutes

func (app *ChainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*ChainApp) RegisterNodeService

func (app *ChainApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)

func (*ChainApp) RegisterTendermintService

func (app *ChainApp) RegisterTendermintService(clientCtx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*ChainApp) RegisterTxService

func (app *ChainApp) RegisterTxService(clientCtx client.Context)

RegisterTxService implements the Application.RegisterTxService method.

func (*ChainApp) RegisterUpgradeHandlers

func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec)

func (*ChainApp) SimulationManager

func (app *ChainApp) SimulationManager() *module.SimulationManager

SimulationManager implements the SimulationApp interface

func (*ChainApp) TxConfig

func (app *ChainApp) TxConfig() client.TxConfig

type GenesisState

type GenesisState map[string]json.RawMessage

GenesisState The genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default state for the application.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCKeeper     *keeper.Keeper
	CircuitKeeper circuitante.CircuitBreaker
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

type RootMultiStore

type RootMultiStore interface {
	storetypes.MultiStore

	// LatestVersion returns the latest version in the store
	LatestVersion() int64
}

RootMultiStore this is source from https://github.com/crypto-org-chain/cosmos-sdk/blob/release/v0.50.x/store/types/store.go

type ValidateMsgTransferDecorator

type ValidateMsgTransferDecorator struct{}

ValidateMsgTransferDecorator is a temporary decorator that limit the field length of MsgTransfer message.

func NewValidateMsgTransferDecorator

func NewValidateMsgTransferDecorator() ValidateMsgTransferDecorator

func (ValidateMsgTransferDecorator) AnteHandle

func (vtd ValidateMsgTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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